﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Giaiphongmatbang.BLL;
using Giaiphongmatbang.DataModel;
using System.Text;
using System.Reflection;
using System.IO;
using COMExcel = Microsoft.Office.Interop.Excel;
using System.Net;

namespace Giaiphongmatbang.BLL
{
    public class Exports
    {
        Giaiphongmatbang.DataAccess.GPMBDataContext datacontext = new DataAccess.GPMBDataContext();
        QLGPMBEntities db = new QLGPMBEntities();

        public Table getinfoHouseHold(string cmnd, int projectID)
        {
            Table info = new Table();
            info.Font.Name = "Times New Roman";
            TableRow row;
            TableCell cell;

            HouseHold h = new HouseHoldRepository().GetByCMND(cmnd);
            Project p = new ProjectsRepository().GetByID(projectID);

            row = new TableRow();
            row.Width = 200;
            row.Font.Bold = true;
            row.VerticalAlign = VerticalAlign.Middle;

            cell = new TableCell();
            cell.Text = "Tên chủ hộ: " + h.FullName.ToString();
            row.Cells.Add(cell);
            info.Rows.Add(row);

            row = new TableRow();
            row.Width = 200;
            row.Font.Bold = true;
            row.VerticalAlign = VerticalAlign.Middle;

            cell = new TableCell();
            cell.Text = "Địa chỉ: " + h.Address.ToString();
            row.Cells.Add(cell);
            info.Rows.Add(row);

            row = new TableRow();
            row.Width = 200;
            row.Font.Bold = true;
            row.VerticalAlign = VerticalAlign.Middle;

            cell = new TableCell();
            cell.Text = "Số điện thoại: " + h.PhoneNumber.ToString();
            row.Cells.Add(cell);
            info.Rows.Add(row);

            row = new TableRow();
            row.Width = 200;
            row.Font.Bold = true;
            row.VerticalAlign = VerticalAlign.Middle;

            cell = new TableCell();
            cell.Text = "Số nhân khẩu: " + h.MemberCount.ToString();
            row.Cells.Add(cell);
            info.Rows.Add(row);

            row = new TableRow();
            row.Width = 200;
            row.Font.Bold = true;
            row.VerticalAlign = VerticalAlign.Middle;

            cell = new TableCell();
            cell.Text = "Tên dự án: " + p.ProjectName.ToString();
            row.Cells.Add(cell);
            info.Rows.Add(row);

            return info;
        }

        public Table getBuilding(string cmnd, int projectid, IEnumerable<Giaiphongmatbang.DataAccess.uspInventoryBuildingResult> build)
        {
            // var build = datacontext.uspInventoryBuilding(projectid);
            Table tb = new Table();
            TableCell cell;
            TableRow row;

            row = new TableRow();

            //header loại cây trồng
            cell = new TableCell();
            cell.Text = "Loại công trình xây dựng";
            row.Cells.Add(cell);

            //header DVT
            cell = new TableCell();
            cell.Text = "Đơn vị";
            row.Cells.Add(cell);

            //header giá
            cell = new TableCell();
            cell.Text = "Đơn giá(VNĐ)";
            row.Cells.Add(cell);

            //header số lượng
            cell = new TableCell();
            cell.Text = "Số lượng";
            row.Cells.Add(cell);

            //Header thành tiền
            cell = new TableCell();
            cell.Text = "Thành tiền(VNĐ)";
            row.Cells.Add(cell);
            //thêm row vào table

            tb.Rows.Add(row);

            var listbuild = build.Where(p => p.CMND == cmnd);

            //thêm content
            foreach (var item in listbuild)
            {
                row = new TableRow(); ;

                cell = new TableCell();
                cell.Text = getBuildParent(item.BuildingID);
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = item.Unit.ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = (1 * (int)item.UnitPrice).ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = item.Quantity.ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = ((double)item.UnitPrice * item.Quantity).ToString();
                row.Cells.Add(cell);

                tb.Rows.Add(row);
            }
            return tb;

        }

        public Table getGrave(string cmnd, int projectid, IEnumerable<Giaiphongmatbang.DataAccess.uspInventoryGraveResult> grave)
        {
            //var grave = datacontext.uspInventoryGrave(projectid);
            Table tb = new Table();
            TableCell cell;
            TableRow row;

            row = new TableRow();
            row.Font.Name = "Times New Roman";
            row.Font.Bold = true;

            //header loại cây trồng
            cell = new TableCell();
            cell.Text = "Loại mồ mả";
            row.Cells.Add(cell);

            //header DVT
            cell = new TableCell();
            cell.Text = "Đơn vị";
            row.Cells.Add(cell);

            //header giá
            cell = new TableCell();
            cell.Text = "Đơn giá";
            row.Cells.Add(cell);

            //header số lượng
            cell = new TableCell();
            cell.Text = "Số lượng";
            row.Cells.Add(cell);

            //Header thành tiền
            cell = new TableCell();
            cell.Text = "Thành tiền";
            row.Cells.Add(cell);
            //thêm row vào table

            tb.Rows.Add(row);
            //thêm content

            var listgrave = grave.Where(p => p.CMND == cmnd);

            foreach (var item in listgrave)
            {
                row = new TableRow();

                cell = new TableCell();
                cell.Text = getGraveParent(item.GraveID);
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = item.Unit.ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = (1 * (int)item.UnitPrice).ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = item.Quantity.ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = ((double)item.UnitPrice * item.Quantity).ToString();
                row.Cells.Add(cell);

                tb.Rows.Add(row);
            }
            return tb;

        }

        public Table getHouse(string cmnd, int projectid, IEnumerable<Giaiphongmatbang.DataAccess.uspInventoryHouseHoldResult> house)
        {
            //var house = datacontext.uspInventoryHouseHold(projectid);
            Table tb = new Table();
            TableCell cell;
            TableRow row;

            row = new TableRow();

            //header loại cây trồng
            cell = new TableCell();
            cell.Text = "Nhà ở và công trình xây dựng";
            row.Cells.Add(cell);

            //header DVT
            cell = new TableCell();
            cell.Text = "Đơn vị";
            row.Cells.Add(cell);

            //header giá
            cell = new TableCell();
            cell.Text = "Đơn giá";
            row.Cells.Add(cell);

            //header số lượng
            cell = new TableCell();
            cell.Text = "Số lượng";
            row.Cells.Add(cell);

            //Header thành tiền
            cell = new TableCell();
            cell.Text = "Thành tiền";
            row.Cells.Add(cell);
            //thêm row vào table

            var listhouse = house.Where(p => p.CMND == cmnd);

            tb.Rows.Add(row);
            //thêm content

            foreach (var item in listhouse)
            {
                row = new TableRow();

                cell = new TableCell();
                cell.Text = getHouseParent(item.HouseID);
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = item.Unit.ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = (1 * (int)item.UnitPrice).ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = item.Quantity.ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = ((double)item.UnitPrice * item.Quantity).ToString();
                row.Cells.Add(cell);

                tb.Rows.Add(row);
            }
            return tb;

        }

        public Table getTree(string cmnd, int projectid, IEnumerable<DataAccess.uspInventoryTreeResult> tree)
        {
            //var tree = datacontext.uspInventoryTree(projectid);
            Table tb = new Table();
            TableCell cell;
            TableRow row;

            row = new TableRow();

            //header loại cây trồng

            cell = new TableCell();
            cell.Text = "Cây cối hoa màu";
            row.Cells.Add(cell);

            //header DVT
            cell = new TableCell();
            cell.Text = "Đơn vị";
            row.Cells.Add(cell);

            //header giá
            cell = new TableCell();
            cell.Text = "Đơn giá";
            row.Cells.Add(cell);

            //header số lượng
            cell = new TableCell();
            cell.Text = "Số lượng";
            row.Cells.Add(cell);

            //Header thành tiền
            cell = new TableCell();
            cell.Text = "Thành tiền";
            row.Cells.Add(cell);
            //thêm row vào table

            tb.Rows.Add(row);

            var listtree = tree.Where(p => p.CMND == cmnd);

            //thêm content
            foreach (var item in listtree)
            {
                row = new TableRow();

                cell = new TableCell();
                cell.Text = getTreeParent(item.TreeID);
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = item.Unit.ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = (1 * (int)item.UnitPrice).ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = item.Quantity.ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = ((double)item.UnitPrice * item.Quantity).ToString();
                row.Cells.Add(cell);

                tb.Rows.Add(row);
            }
            return tb;

        }

        //public Table getLand(string cmnd, int projectid, IEnumerable<Giaiphongmatbang.DataAccess.uspInventoryLandResult> land)
        //{
        //    //var build = datacontext.uspInventoryLand(cmnd, projectid);
        //    Table tb = new Table();
        //    TableCell cell;
        //    TableRow row;

        //    row = new TableRow();

        //    //header loại đất
        //    cell = new TableCell();
        //    cell.Text = "Loại đất";
        //    row.Cells.Add(cell);

        //    //header vị trí
        //    cell = new TableCell();
        //    cell.Text = "Vị trí";
        //    row.Cells.Add(cell);

        //    //header thửa
        //    cell = new TableCell();
        //    cell.Text = "Thửa";
        //    row.Cells.Add(cell);

        //    //header tờ bản đồ
        //    cell = new TableCell();
        //    cell.Text = "Tờ bản đồ";
        //    row.Cells.Add(cell);

        //    //header DVT
        //    cell = new TableCell();
        //    cell.Text = "Đơn vị";
        //    row.Cells.Add(cell);

        //    //header giá
        //    cell = new TableCell();
        //    cell.Text = "Đơn giá";
        //    row.Cells.Add(cell);

        //    //header số lượng
        //    cell = new TableCell();
        //    cell.Text = "Số lượng";
        //    row.Cells.Add(cell);

        //    //Header thành tiền
        //    cell = new TableCell();
        //    cell.Text = "Thành tiền";
        //    row.Cells.Add(cell);

        //    //thêm row vào table
        //    tb.Rows.Add(row);

        //    var listland = land.Where(p => p.CMND == cmnd);

        //    //thêm content
        //    foreach (var item in listland)
        //    {
        //        row = new TableRow();

        //        cell = new TableCell();
        //        cell.Text = getLandParent(item.LandID);
        //        row.Cells.Add(cell);

        //        cell = new TableCell();
        //        cell.Text = item.Position.ToString();
        //        row.Cells.Add(cell);

        //        cell = new TableCell();
        //        cell.Text = item.Plot.ToString();
        //        row.Cells.Add(cell);

        //        cell = new TableCell();
        //        cell.Text = item.ofMap.ToString();
        //        row.Cells.Add(cell);

        //        cell = new TableCell();
        //        cell.Text = item.Unit.ToString();
        //        row.Cells.Add(cell);

        //        cell = new TableCell();
        //        cell.Text = (1 * (int)item.UnitPrice).ToString();
        //        row.Cells.Add(cell);

        //        cell = new TableCell();
        //        cell.Text = item.Areas.ToString();
        //        row.Cells.Add(cell);

        //        cell = new TableCell();
        //        cell.Text = ((double)item.UnitPrice * item.Areas).ToString();
        //        row.Cells.Add(cell);

        //        tb.Rows.Add(row);
        //    }
        //    return tb;

        //}

        public Table getSupport(string cmnd, int projectid, IEnumerable<DataAccess.uspSupportJobResult> job, IEnumerable<DataAccess.uspSupportMoveResult> move, IEnumerable<DataAccess.uspSupportOtherResult> other, IEnumerable<DataAccess.uspSupportRentResult> rent, IEnumerable<DataAccess.uspSupportStabilizeResult> stabilize)
        {
            Table tb = new Table();
            TableRow row;
            TableCell cell;

            row = new TableRow();

            cell = new TableCell();
            cell.Text = "Loại hỗ trợ";
            row.Cells.Add(cell);

            cell = new TableCell();
            cell.Text = "Đơn vị";
            row.Cells.Add(cell);

            cell = new TableCell();
            cell.Text = "Mức hỗ trợ";
            row.Cells.Add(cell);

            cell = new TableCell();
            cell.Text = "Số lượng";
            row.Cells.Add(cell);

            cell = new TableCell();
            cell.Text = "Thành tiền";
            row.Cells.Add(cell);

            tb.Rows.Add(row);

            //ho tro di chuyen
            #region Hỗ trợ di chuyển
            var listmove = move.Where(p => p.CMND == cmnd);
            foreach (var item in listmove)
            {
                row = new TableRow();

                cell = new TableCell();
                cell.Text = item.SupportName.ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = "";
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = (1 * (int)item.Cost).ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = "";
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = (1 * (int)item.Cost).ToString();
                row.Cells.Add(cell);
                tb.Rows.Add(row);
            }
            #endregion

            //Hỗ trợ nghề nghiệp
            #region Hỗ trợ nghề nghiệp
            var listjob = job.Where(p => p.CMND == cmnd);
            foreach (var item in listjob)
            {
                row = new TableRow();

                cell = new TableCell();
                cell.Text = item.SupportName.ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = "";
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = (1 * (int)item.UnitPrice).ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = "";
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = (1 * (int)item.UnitPrice).ToString();
                row.Cells.Add(cell);

                tb.Rows.Add(row);
            }
            #endregion

            //hỗ trợ thuê nhà
            #region Hỗ trợ thuê nhà
            var listrent = rent.Where(p => p.CMND == cmnd);
            foreach (var item in rent)
            {
                row = new TableRow();

                cell = new TableCell();
                cell.Text = item.SupportName.ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = item.Unit.ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = (1 * (int)item.UnitPrice).ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = item.QuantityRent.ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = (item.QuantityRent * (int)item.UnitPrice).ToString();
                row.Cells.Add(cell);

                tb.Rows.Add(row);
            }
            #endregion

            //Hỗ trợ ổn định đời sống
            #region Hỗ trợ ổn định đời sống
            var liststabilize = stabilize.Where(p => p.CMND == cmnd);
            foreach (var item in liststabilize)
            {
                row = new TableRow();

                cell = new TableCell();
                cell.Text = item.SupportName.ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = item.Unit.ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = (1 * (int)item.UnitPrice).ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = item.QuantityStabilize.ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = (item.QuantityStabilize * (int)item.UnitPrice).ToString();
                row.Cells.Add(cell);

                tb.Rows.Add(row);
            }
            #endregion

            //Hỗ trợ khác
            #region Hỗ trợ khác
            var listother = other.Where(p => p.CMND == cmnd);
            foreach (var item in listother)
            {
                row = new TableRow();

                cell = new TableCell();
                cell.Text = item.SupportName.ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = "";
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = (1 * (int)item.UnitPrice).ToString();
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = "";
                row.Cells.Add(cell);

                cell = new TableCell();
                cell.Text = (1 * (int)item.UnitPrice).ToString();
                row.Cells.Add(cell);

                tb.Rows.Add(row);
            }
            #endregion

            return tb;
        }

        public string getBuildParent(int id)
        {
            Building b = new BuildingsRepository().GetByID(id);
            string name = b.BuildingName;
            while (b.ParentID != 0)
            {
                b = new BuildingsRepository().GetByID(b.ParentID);
                name = b.BuildingName + " - " + name;
            }
            return name;
        }

        public string getGraveParent(int id)
        {
            Grave g = new GravesRepository().GetByID(id);
            string parentname = g.GraveName;
            while (g.ParentID != 0)
            {
                g = new GravesRepository().GetByID(g.ParentID);
                parentname = g.GraveName + " - " + parentname;
            }
            return parentname;
        }

        public string getHouseParent(int id)
        {
            HouseType h = new HouseTypesRepository().GetByID(id);
            string name = h.Type;
            while (h.ParentID != 0)
            {
                h = new HouseTypesRepository().GetByID(h.ParentID);
                name = h.Type + " - " + name;
            }
            return name;
        }

        public string getTreeParent(int id)
        {
            Tree t = new TreesRepository().GetByID(id);
            string name = t.TreeName;
            while (t.ParentID != 0)
            {
                t = new TreesRepository().GetByID(t.ParentID);
                name = t.TreeName + " - " + name;
            }
            return name;
        }
        /// <summary>
        /// Trả về max của một mảng
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        int Max(params int?[] param)
        {
            int max = param[0].Value;
            foreach (var item in param)
            {
                if (item.Value > max) max = item.Value;
            }
            return max;
        }

        /// <summary>
        /// Lấy về danh sách các chủ hộ và danh sách đền bù - hỗ trợ
        /// </summary>
        /// <returns></returns>
        public string getEstimateByProjectID(int ProjectID)
        {
            DataAccess.GPMBDataContext db = new DataAccess.GPMBDataContext();
            int? totalRow = 0;
            var listHouseHold = db.uspGetHouseHoldByProjectID(ProjectID, ref totalRow);
            var project = db.Projects.FirstOrDefault(p => p.ProjectID == ProjectID);
            int count = 1;
            int? TotalRowLand = 0, TotalRowTree = 0, TotalRowBuilding = 0, TotalRowHouse = 0, TotalRowGrave = 0;
            int? TotalRowSupportJob = 0, TotalRowSupportMove = 0, TotalRowSupportRent = 0, TotalRowSupportStabilize = 0, TotalRowSupportOther = 0;

            var inventLand = db.uspGetInventLand(ProjectID, ref TotalRowLand).ToArray();
            var inventTree = db.uspGetInventTree(ProjectID, ref TotalRowTree).ToArray();
            var inventBuilding = db.uspGetInventBuilding(ProjectID, ref TotalRowBuilding).ToArray();
            var inventHouse = db.uspGetInventHouse(ProjectID, ref TotalRowHouse).ToArray();
            var inventGrave = db.uspGetInventGrave(ProjectID, ref TotalRowGrave).ToArray();
            var supportJob = db.uspEstimateSupportJob(ProjectID, ref TotalRowSupportJob).ToArray();
            var supportRent = db.uspEstimateSupportRent(ProjectID, ref TotalRowSupportRent).ToArray();
            var supportStabilize = db.uspEstimateSupportStabilize(ProjectID, ref TotalRowSupportStabilize).ToArray();
            var supportMove = db.uspEstimateSupportMove(ProjectID, ref TotalRowSupportMove).ToArray();
            var supportOther = db.uspEstimateSupportOther(ProjectID, ref TotalRowSupportOther).ToArray();
            int? totalSupport = TotalRowSupportMove + TotalRowSupportRent + TotalRowSupportStabilize + TotalRowSupportOther;
            StringBuilder result = new StringBuilder();
            result.AppendLine("<table border=0 width='100%' >");
            result.AppendLine("<tr><td align=center><b>UBND HUYỆN HƯNG NGUYÊN <br>HĐ GPMB CẤP TỈNH</b></td><td align=center><b>CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM <br>Độc lập - Tự do - Hạnh phúc</b></td></tr>");
            result.AppendLine("</table>");
            result.AppendLine("<p class=MsoNormal>&nbsp;</p>");
            result.AppendLine("<p class=MsoNormal style='text-align:center'><b>BẢNG TỔNG HỢP CHI TIẾT</b></p>");
            result.AppendLine("<p class=MsoNormal style='text-align:center'><b>PHƯƠNG ÁN BỒI THƯỜNG HỖ TRỢ GPMB</b></p>");
            result.AppendLine("<p class=MsoNormal style='text-align:center'><b>DỰ ÁN " + project.ProjectName.ToUpper() + "</b></p>");
            result.AppendLine("<p class=MsoNormal>&nbsp;</p>");
            double? totalAmounts = 0;
            #region tieude
            result.AppendLine("<table border='1' style='border-collapse:collapse;'>");
            result.AppendLine("<thead>");
            result.AppendLine("<tr>"
                                + "<th width='40' rowspan='3'>TT</th>"
                                + "<th width='300' rowspan='3'>TÊN CHỦ HỘ</th>"
                                + "<th width='300' rowspan='3'> ĐỊA CHỈ</th>"
                            );
            int colspan = 3;
            if (TotalRowTree > 0) colspan += 2;
            if (TotalRowHouse > 0) colspan += 2;
            if (TotalRowGrave > 0) colspan += 2;
            if (TotalRowBuilding > 0) colspan += 2;
            result.AppendLine("<th colspan='" + colspan + "'>DANH SÁCH THIỆT HẠI - ĐỀN BÙ</th>");
            result.AppendLine("<th colspan='" + (totalSupport > 0 ? 3 : 0) + "'>HỖ TRỢ</th>"
                            + "<th width='140' rowspan='3'>TỔNG TIỀN</th>"
                            + "</tr>"
                            );
            result.AppendLine("<tr>");
            result.AppendLine("<th colspan='3'>Bồi thường đất</th>");
            if (TotalRowTree > 0) result.AppendLine("<th colspan='2'>Bồi thường hoa màu</th>");
            if (TotalRowHouse > 0) result.AppendLine("<th colspan='2'>Bồi thường nhà cửa</th>");
            if (TotalRowBuilding > 0) result.AppendLine("<th colspan='2'>Bồi thường công trình - vlkt</th>");
            if (TotalRowGrave > 0) result.AppendLine("<th colspan='2'>Bồi thường mồ mả</th>");
            result.AppendLine("<th rowspan='2'>Hỗ trợ việc làm</th>");
            if (totalSupport > 0)
            {
                result.AppendLine("<th colspan='2'>Hỗ trợ khác</th>");
            }
            result.AppendLine("</tr>");
            result.AppendLine("<tr>");
            result.AppendLine("<th width='79'>Diện tích </th>"
                               + "<th width='78'>Đơn giá </th>"
                               + "<th width='98'>Thành tiền </th>"
                               );
            if (TotalRowTree > 0)
            {
                result.AppendLine("<th width='160'>Loại hoa màu </th>"
                                + "<th width='74'>Thành tiền </th>"
                                );
            }
            if (TotalRowHouse > 0)
            {
                result.AppendLine("<th width='160'>Loại nhà cửa </th>"
                                   + "<th width='54'>Thành tiền </th>"
                                   );
            }
            if (TotalRowBuilding > 0)
            {
                result.AppendLine("<th width='128'>Tên công trình </th>"
                                  + "<th width='90'>Thành tiền </th>"
                                  );
            }
            if (TotalRowGrave > 0)
            {
                result.AppendLine("<th width='159'>Tên mồ mả </th>"
                                  + "<th width='67'>Thành tiền </th>"
                                  );
            }
            if (totalSupport > 0)
            {
                result.AppendLine("<th width='180'>Tên hỗ trợ </th>"
                                   + "<th width='140'>Thành tiền </th>"
                                   );
            } 
            result.AppendLine("</tr>");
            result.AppendLine("</thead>");
            int tableRowCount = colspan + (totalSupport > 0 ? 3 : 1) + 3;
            #endregion
            foreach (var item in listHouseHold)
            {
                var listLand = inventLand.Where(p => p.CMND.Equals(item.CMND)).ToArray();
                int countLand = listLand.Count();
                var listTree = inventTree.Where(p => p.CMND.Equals(item.CMND)).ToArray();
                int countTree = listTree.Count();
                var listBuilding = inventBuilding.Where(p => p.CMND.Equals(item.CMND)).ToArray();
                int countBuilding = listBuilding.Count();
                var listHouse = inventHouse.Where(p => p.CMND.Equals(item.CMND)).ToArray();
                int countHouse = listHouse.Count();
                var listGrave = inventGrave.Where(p => p.CMND.Equals(item.CMND)).ToArray();
                int countGrave = listGrave.Count();

                var listSupportJob = supportJob.Where(p => p.CMND.Equals(item.CMND)).ToArray();
                int countJob = listSupportJob.Count();
                var listSupportMove = supportMove.Where(p => p.CMND.Equals(item.CMND)).ToArray();
                int countMove = listSupportMove.Count();
                var listSupportStabilize = supportStabilize.Where(p => p.CMND.Equals(item.CMND)).ToArray();
                int countStabilize = listSupportStabilize.Count();
                var listSupportRent = supportRent.Where(p => p.CMND.Equals(item.CMND)).ToArray();
                int countRent = listSupportRent.Count();
                var listSupportOther = supportOther.Where(p => p.CMND.Equals(item.CMND)).ToArray();
                var totalAmount = listLand.Sum(p => p.toAmounts) + listTree.Sum(p => p.toAmount) + listBuilding.Sum(p => p.toAmount) + listHouse.Sum(p => p.toAmount) + listGrave.Sum(p => p.toAmount)
                                    + listSupportJob.Sum(p => p.toAmount) + (double)listSupportMove.Sum(p => p.toAmount) + (double)listSupportOther.Sum(p => p.toAmount) + (double)listSupportRent.Sum(p => p.toAmount) + (double)listSupportStabilize.Sum(p => p.toAmount);
                totalAmounts += totalAmount;
                int countOther = listSupportOther.Count();
                int index = 0;
                int MaxRow = Max(countLand, countTree, countBuilding, countHouse, countGrave, countJob, countMove + countStabilize + countRent + countOther);
                int r = 0, m = 0, s = 0, o = 0;
                for (int i = 0; i < MaxRow; i++)
                {
                    result.AppendLine("<tr>");
                    if (index == 0)
                    {
                        result.AppendLine("<td rowspan='" + MaxRow + "'>" + count + "</td>");
                        result.AppendLine("<td rowspan='" + MaxRow + "'>" + item.FullName + "</td>");
                        result.AppendLine("<td rowspan='" + MaxRow + "'>" + item.Address + " - " + item.VillageName + "</td>");
                    }
                    DataAccess.uspGetInventLandResult land = new DataAccess.uspGetInventLandResult();
                    try
                    {
                        land = listLand[i];
                    }
                    catch { }
                    result.AppendLine("<td>" + land.Areas + "</td>");
                    result.AppendLine("<td>" + (int?)land.UnitPrice + "</td>");
                    result.AppendLine("<td>" + land.toAmounts + "</td>");
                    if (TotalRowTree > 0)
                    {
                        DataAccess.uspGetInventTreeResult tree = new DataAccess.uspGetInventTreeResult();
                        try
                        {
                            tree = listTree[i];
                        }
                        catch { }
                        result.AppendLine("<td>" + tree.TreeName + "</td>");
                        result.AppendLine("<td>" + tree.toAmount + "</td>");
                    }
                    if (TotalRowHouse > 0)
                    {
                        DataAccess.uspGetInventHouseResult house = new DataAccess.uspGetInventHouseResult();
                        try
                        {
                            house = listHouse[i];
                        }
                        catch { }
                        result.AppendLine("<td>" + house.Type + "</td>");
                        result.AppendLine("<td>" + house.toAmount + "</td>");
                    }
                    if (TotalRowBuilding > 0)
                    {
                        DataAccess.uspGetInventBuildingResult building = new DataAccess.uspGetInventBuildingResult();
                        try
                        {
                            building = listBuilding[i];
                        }
                        catch { }
                        result.AppendLine("<td>" + building.BuildingName + "</td>");
                        result.AppendLine("<td>" + building.toAmount + "</td>");
                    }
                    if (TotalRowGrave > 0)
                    {
                        DataAccess.uspGetInventGraveResult grave = new DataAccess.uspGetInventGraveResult();
                        try
                        {
                            grave = listGrave[i];
                        }
                        catch { }
                        result.AppendLine("<td>" + grave.GraveName + "</td>");
                        result.AppendLine("<td>" + grave.toAmount + "</td>");
                    }
                    //Hỗ trợ                    
                    var Job = new DataAccess.uspEstimateSupportJobResult();
                    try
                    {
                        Job = listSupportJob[i];
                    }
                    catch { }
                    result.AppendLine("<td>" + Job.toAmount + "</td>");
                    if (totalSupport > 0)
                    {
                        var Other = new DataAccess.uspEstimateSupportOtherResult();
                        var Rent = new DataAccess.uspEstimateSupportRentResult();
                        var Stabilize = new DataAccess.uspEstimateSupportStabilizeResult();
                        var Move = new DataAccess.uspEstimateSupportMoveResult();

                        try
                        {
                            Rent = listSupportRent[r];
                            result.AppendLine("<td>" + Rent.SupportName + "</td>");
                            result.AppendLine("<td>" + (double?)Rent.toAmount + "</td>");
                            r++;
                        }
                        catch
                        {
                            try
                            {
                                Stabilize = listSupportStabilize[s];
                                result.AppendLine("<td> Hỗ trợ ổn định đời sống</td>");
                                result.AppendLine("<td>" + (double?)Stabilize.toAmount + "</td>");
                                s++;
                            }
                            catch
                            {
                                try
                                {
                                    Move = listSupportMove[m];
                                    result.AppendLine("<td>" + Move.SupportName + "</td>");
                                    result.AppendLine("<td>" + (double?)Move.toAmount + "</td>");
                                    m++;
                                }
                                catch
                                {
                                    try
                                    {
                                        Other = listSupportOther[o];
                                        result.AppendLine("<td>" + Other.SupportName + "</td>");
                                        result.AppendLine("<td>" + (double?)Other.toAmount + "</td>");
                                        o++;
                                    }
                                    catch
                                    {
                                        result.AppendLine("<td>&nbsp;</td>");
                                        result.AppendLine("<td>&nbsp;</td>");
                                    }
                                }
                            }
                        }
                    }
                    if (index == 0)
                    {
                        result.AppendLine("<td rowspan='" + MaxRow + "'>" + ((double)totalAmount).ToString("###,###") + "</td>");
                    }
                    result.AppendLine("</tr>");
                    index++;
                }
                if (MaxRow > 0) count++;
            }
            //Tổng chi phí
            result.AppendLine("<tr><td align='center' colspan='" + tableRowCount + "'> <b>Tổng chi phí</b> </td><td><b>" + ((double)totalAmounts).ToString("###,###") + "</b></td></tr>");
            result.AppendLine("</table>");
            result.AppendLine("<div style='margin: 10px 8px'>");
            result.AppendLine("<table>");
            result.AppendLine("<tr><td>&nbsp</td><td width=340 style='padding:3px'><b>Tổng chi phí đền bù , hỗ trợ: </b></td><td>" + ((double)totalAmounts).ToString("###,###") + " VNĐ (Bằng chữ: " + Utility.Utilities.DocTienBangChu((long)totalAmounts, "đồng") + " )</td></tr>");
            result.AppendLine("<tr><td>&nbsp</td><td width=340 style='padding:3px'><b>Kinh phí thực hiện (" + project.Costs + "% chi phí đền bù, hỗ trợ): </b></td><td>" + ((double)totalAmounts * project.Costs / 100).ToString("###,###") + " VNĐ (Bằng chữ: " + Utility.Utilities.DocTienBangChu((long)(totalAmounts * project.Costs / 100), "đồng") + " )</td></tr>");
            result.AppendLine("<tr><td>&nbsp</td><td width=340 style='padding:3px'><b>Tổng kinh phí của dự án: </b></td><td>" + ((double)totalAmounts * (1 + project.Costs / 100)).ToString("###,###") + " VNĐ (Bằng chữ: " + Utility.Utilities.DocTienBangChu((long)(totalAmounts * (1 + project.Costs / 100)), "đồng") + " )</td></tr>");
            result.AppendLine("</table>");
            result.AppendLine("</div");
            result.AppendLine("<p class=MsoNormal>&nbsp;</p>");
            
            result.AppendLine("<table border=0 width='100%' >");
            result.AppendLine("<tr><th>NGƯỜI LẬP BIỂU</th><th>TRƯỞNG BAN GPMB</th><th>CHỦ TỊCH HỘI ĐỒNG GPMB</th></tr>");
            result.AppendLine("</table>");
            return result.ToString();
        }

        public string getEstimateByProjectID1(int ProjectID)
        {
            DataAccess.GPMBDataContext db = new DataAccess.GPMBDataContext();
            int? totalRow = 0;
            var listHouseHold = db.uspGetHouseHoldByProjectID(ProjectID, ref totalRow);
            var project = db.Projects.FirstOrDefault(p => p.ProjectID == ProjectID);
            int count = 1;
            int? TotalRowLand = 0, TotalRowTree = 0, TotalRowBuilding = 0, TotalRowHouse = 0, TotalRowGrave = 0;
            int? TotalRowSupportJob = 0, TotalRowSupportMove = 0, TotalRowSupportRent = 0, TotalRowSupportStabilize = 0, TotalRowSupportOther = 0;

            var inventLand = db.uspGetInventLand(ProjectID, ref TotalRowLand).ToArray();
            var inventTree = db.uspGetInventTree(ProjectID, ref TotalRowTree).ToArray();
            var inventBuilding = db.uspGetInventBuilding(ProjectID, ref TotalRowBuilding).ToArray();
            var inventHouse = db.uspGetInventHouse(ProjectID, ref TotalRowHouse).ToArray();
            var inventGrave = db.uspGetInventGrave(ProjectID, ref TotalRowGrave).ToArray();
            var supportJob = db.uspEstimateSupportJob(ProjectID, ref TotalRowSupportJob).ToArray();
            var supportRent = db.uspEstimateSupportRent(ProjectID, ref TotalRowSupportRent).ToArray();
            var supportStabilize = db.uspEstimateSupportStabilize(ProjectID, ref TotalRowSupportStabilize).ToArray();
            var supportMove = db.uspEstimateSupportMove(ProjectID, ref TotalRowSupportMove).ToArray();
            var supportOther = db.uspEstimateSupportOther(ProjectID, ref TotalRowSupportOther).ToArray();
            int? totalSupport = TotalRowSupportMove + TotalRowSupportRent + TotalRowSupportStabilize + TotalRowSupportOther;
            StringBuilder result = new StringBuilder();
            result.AppendLine("<table border=0 width='100%' >");
            result.AppendLine("<tr><td align=center><b>UBND HUYỆN HƯNG NGUYÊN <br><u>HĐ GPMB CẤP TỈNH</u></b></td><td align=center><b>CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM <br><u>Độc lập - Tự do - Hạnh phúc</u></b></td></tr>");
            result.AppendLine("</table>");
            result.AppendLine("<p class=MsoNormal>&nbsp;</p>");
            result.AppendLine("<p class=MsoNormal style='text-align:center'><b>BẢNG TỔNG HỢP DANH SÁCH THU HỒI ĐẤT VÀ PHƯƠNG ÁN BỒI THƯỜNG,</b></p>");
            result.AppendLine("<p class=MsoNormal style='text-align:center'><b>HỖ TRỢ GPMB DỰ ÁN: " + project.ProjectName.ToUpper() + "</b></p>");
            result.AppendLine("<p class=MsoNormal style='text-align:center'><b>Ban hành kèm theo Tờ trình số:&nbsp;&nbsp;&nbsp;/TTr-GPMB ngày.....thánh.....năm 20... của Hội đồng GPMB.CT cấp tỉnh huyện Hưng Nguyên</b></p>");
            result.AppendLine("<p class=MsoNormal>&nbsp;</p>");
            double? totalAmounts = 0;
            #region tieude
            result.AppendLine("<table border='1' style='border-collapse:collapse;'>");
            result.AppendLine("<thead>");
            result.AppendLine("<tr>"
                                + "<th width='40' rowspan='2'>TT</th>"
                                + "<th width='200' rowspan='2'>TÊN CHỦ HỘ</th>"
                                + "<th width='230' rowspan='2'> ĐỊA CHỈ</th>"
                                + "<th width='80' rowspan='2'>DT thu hồi (m2)</th>"
                            );
            result.AppendLine("<th colspan='3'>DANH SÁCH BỒI THƯỜNG HỖ TRỢ</th>");
            result.AppendLine("<th width='140' rowspan='2'>TỔNG TIỀN</th>"
                            + "</tr>"
                            );
            result.AppendLine("<tr>");
            result.AppendLine("<th>Bồi thường đất</th>");
            result.AppendLine("<th>Bồi thường hoa màu</th>");
            result.AppendLine("<th>Hỗ trợ</th>");
            result.AppendLine("</tr>");
            result.AppendLine("</thead>");
            #endregion
            foreach (var item in listHouseHold)
            {
                var listLand = inventLand.Where(p => p.CMND.Equals(item.CMND)).ToArray();
                var listTree = inventTree.Where(p => p.CMND.Equals(item.CMND)).ToArray();
                var listBuilding = inventBuilding.Where(p => p.CMND.Equals(item.CMND)).ToArray();
                var listHouse = inventHouse.Where(p => p.CMND.Equals(item.CMND)).ToArray();
                var listGrave = inventGrave.Where(p => p.CMND.Equals(item.CMND)).ToArray();

                var listSupportJob = supportJob.Where(p => p.CMND.Equals(item.CMND)).ToArray();
                var listSupportMove = supportMove.Where(p => p.CMND.Equals(item.CMND)).ToArray();
                var listSupportStabilize = supportStabilize.Where(p => p.CMND.Equals(item.CMND)).ToArray();
                var listSupportRent = supportRent.Where(p => p.CMND.Equals(item.CMND)).ToArray();
                var listSupportOther = supportOther.Where(p => p.CMND.Equals(item.CMND)).ToArray();
                double tiendat = (double)listLand.Sum(p => p.toAmounts);
                double taisan = (double)listTree.Sum(p => p.toAmount) + (double)listBuilding.Sum(p => p.toAmount) + (double)listHouse.Sum(p => p.toAmount) + (double)listGrave.Sum(p => p.toAmount);
                double hotro = (double)listSupportJob.Sum(p => p.toAmount) + (double)listSupportMove.Sum(p => p.toAmount) + (double)listSupportOther.Sum(p => p.toAmount) + (double)listSupportRent.Sum(p => p.toAmount) + (double)listSupportStabilize.Sum(p => p.toAmount);
                double totalAmount = taisan + hotro + tiendat;
                totalAmounts += totalAmount;
                int countOther = listSupportOther.Count();
                result.AppendLine("<tr>");
                result.AppendLine("<td style='text-align:center'>" + count + "</td>");
                result.AppendLine("<td>" + item.FullName + "</td>");
                result.AppendLine("<td>" + item.Address + " - " + item.VillageName + "</td>");
                DataAccess.uspGetInventLandResult land = new DataAccess.uspGetInventLandResult();
                result.AppendLine("<td style='text-align:center'>" + listLand.Sum(p => p.Areas) + "</td>");
                result.AppendLine("<td style='text-align:center'>" + tiendat.ToString("###,###") + "</td>");
                result.AppendLine("<td style='text-align:center'>" + taisan.ToString("###,###") + "</td>");
                result.AppendLine("<td style='text-align:center'>" + hotro.ToString("###,###") + "</td>");
                result.AppendLine("<td style='text-align:center'>" + totalAmount.ToString("###,###") + "</td>");
                result.AppendLine("</tr>");
                count++;
            }
            //Tổng chi phí
            result.AppendLine("<tr><td align='center' colspan='7'> <b>Tổng chi phí</b> </td><td style='text-align:center'><b>" + ((double)totalAmounts).ToString("###,###") + "</b></td></tr>");
            result.AppendLine("</table>");
            result.AppendLine("<div style='margin: 10px 8px'>");
            result.AppendLine("<table>");
            result.AppendLine("<tr><td>&nbsp</td><td width=340 style='padding:3px'><b>Tổng chi phí đền bù , hỗ trợ: </b></td><td>" + ((double)totalAmounts).ToString("###,###") + " VNĐ (Bằng chữ: " + Utility.Utilities.DocTienBangChu((long)totalAmounts, "đồng") + " )</td></tr>");
            result.AppendLine("<tr><td>&nbsp</td><td width=340 style='padding:3px'><b>Kinh phí thực hiện (" + project.Costs + "% chi phí đền bù, hỗ trợ): </b></td><td>" + ((double)totalAmounts * project.Costs / 100).ToString("###,###") + " VNĐ (Bằng chữ: " + Utility.Utilities.DocTienBangChu((long)(totalAmounts * project.Costs / 100), "đồng") + " )</td></tr>");
            result.AppendLine("<tr><td>&nbsp</td><td width=340 style='padding:3px'><b>Tổng kinh phí của dự án: </b></td><td>" + ((double)totalAmounts * (1 + project.Costs / 100)).ToString("###,###") + " VNĐ (Bằng chữ: " + Utility.Utilities.DocTienBangChu((long)(totalAmounts * (1 + project.Costs / 100)), "đồng") + " )</td></tr>");
            result.AppendLine("</table>");
            result.AppendLine("</div");
            result.AppendLine("<p class=MsoNormal>&nbsp;</p>");

            result.AppendLine("<table border=0 width='100%' >");
            result.AppendLine("<tr><th>NGƯỜI LẬP BIỂU</th><th>TRƯỞNG BAN GPMB</th><th>CHỦ TỊCH HỘI ĐỒNG GPMB</th></tr>");
            result.AppendLine("</table>");
            return result.ToString();
        }

        public string getManageByProject(int projectD)
        {
            StringBuilder result = new StringBuilder();
            result.Append("<table class=MsoTableGrid border=0 cellspacing=0 cellpadding=0 style='border-collapse:collapse;");
            result.Append("border:none;mso-yfti-tbllook:1184;mso-padding-alt:0cm 5.4pt 0cm 5.4pt;mso-border-insideh:none;mso-border-insidev:none'>");
            int ttt = 0;
            var mana = datacontext.uspgetManagementByProjectID(projectD).ToArray();
            foreach (var item in mana)
            {
                result.Append("<tr style='mso-yfti-irow:" + ttt + ";mso-yfti-firstrow:yes;height:22.7pt'>");
                result.Append("<td width=243 style='width:182.6pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>- Ông: " + item.FullName + "<o:p></o:p></span></p></td>");
                result.Append("<td width=265 style='width:7.0cm;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>" + item.Representative + "<o:p></o:p></span></p></td>");
                result.Append("<td width=168 style='width:125.85pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>" + item.Order + "<o:p></o:p></span></p></td></tr>");
                ttt++;
            }
            return result.ToString();
        }

        public string getPricePressure(int projectID)
        {
            List<HouseHold> h = new HouseHoldRepository().GetByProjectID(projectID);
            Project project = new ProjectsRepository().GetByID(projectID);
            StringBuilder result = new StringBuilder();

            #region Khai báo dữ liệu
            int? totalrow = 0;
            var Itree = datacontext.uspGetInventTree(projectID, ref totalrow).ToArray();
            var Ihouse = datacontext.uspGetInventHouse(projectID, ref totalrow).ToArray();
            var Igrave = datacontext.uspGetInventGrave(projectID, ref totalrow).ToArray();
            var Ibuild = datacontext.uspGetInventBuilding(projectID, ref totalrow).ToArray();
            var mana = datacontext.uspgetManagementByProjectID(projectID);
            var supportjob = datacontext.uspEstimateSupportJob(projectID, ref totalrow).ToArray();
            var supportmove = datacontext.uspEstimateSupportMove(projectID, ref totalrow).ToArray();
            var supportOther = datacontext.uspEstimateSupportOther(projectID, ref totalrow).ToArray();
            var supportRent = datacontext.uspEstimateSupportRent(projectID, ref totalrow).ToArray();
            var supportstabilizi = datacontext.uspEstimateSupportStabilize(projectID, ref totalrow).ToArray();

            #endregion

            foreach (var hh in h)
            {
                int row = 1;
                double money = 0;
                var listland = datacontext.uspGetAllInventLand(projectID, hh.CMND).ToArray();
                var listtree = Itree.Where(p => p.CMND == hh.CMND);
                var listgrave = Igrave.Where(p => p.CMND == hh.CMND);
                var listhouse = Ihouse.Where(p => p.CMND == hh.CMND);
                var listbuild = Ibuild.Where(p => p.CMND == hh.CMND);
                var listjob = supportjob.Where(p => p.CMND == hh.CMND).FirstOrDefault();
                var liststabilizi = supportstabilizi.Where(p => p.CMND == hh.CMND).FirstOrDefault();
                var listRent = supportRent.Where(p => p.CMND == hh.CMND).FirstOrDefault();
                var listmove = supportmove.Where(p => p.CMND == hh.CMND).FirstOrDefault();
                var listother = supportOther.Where(p => p.CMND == hh.CMND);

                #region header
                result.Append("<table class=MsoTableGrid border=0 cellspacing=0 cellpadding=0 ");
                result.Append("style='border-collapse:collapse;border:none;mso-yfti-tbllook:1184;mso-padding-alt:");
                result.Append("0cm 5.4pt 0cm 5.4pt;mso-border-insideh:none;mso-border-insidev:none'>");
                result.Append("<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes;height:56.2pt'>");
                result.Append("<td width=310 valign=top style='width:232.2pt;padding:0cm 5.4pt 0cm 5.4pt;height:56.2pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>UBND HUYỆN HƯNG NGUYÊN<o:p></o:p></span></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><span style='mso-spacerun:yes'></span><u>HỘI ĐỒNG.GPMB CẤP TỈNH<o:p></o:p></u></span></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><span style='mso-spacerun:yes'></span><o:p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Số:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/HS-GPMB</o:p></span></p>");
                result.Append("</td>");
                result.Append("<td width=366 valign=top style='width:274.7pt;padding:0cm 5.4pt 0cm 5.4pt;height:56.2pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM<o:p></o:p></span></p>");

                result.Append("<p class=MsoNormal align=center style='text-align:center'><u><span style='font-size:13.0pt'>");
                result.Append("Độc lập – Tự do – Hạnh phúc<o:p></o:p></span></u></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td></tr></table>");

                result.Append("<p class=MsoNormal align=center style='text-align:center'>");
                result.Append("<span style='font-size:13.0pt'>BIÊN BẢN XÁC ĐỊNH GIÁ TRỊ BỒI THƯỜNG, HỖ TRỢ VÀ TÁI ĐỊNH CƯ<o:p></o:p></span></p>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'>");
                result.Append("<span style='font-size:13.0pt'>do thu hồi đất để thực hiện Dự án: ");
                result.Append(project.ProjectName.ToUpper());
                result.Append("<o:p></o:p></span></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><span style='mso-tab-count:1'>");
                result.Append("</span>Hôm nay, vào hồi........h, ngày........tháng........năm 20....<o:p></o:p></span></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>");
                result.Append("<span style='mso-spacerun:yes'></span>");

                result.Append("Căn cứ vào biên bản kiểm kê hiện trạng, hồ sơ liên quan về đất đai và các chế độ bồi thường, ");
                result.Append("hỗ trợ hiện hành, hội đồng GPMB huyện tiến hành xác định giá trị bồi thường, ");
                result.Append("hỗ trợ về đấ và các tài sản trên đất của chủ hộ như sau:<o:p></o:p></span></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Chủ hộ: ");
                result.Append("Ông(bà).........................");
                result.Append(hh.FullName + "......................");
                result.Append("Có....." + hh.MemberCount + "...nhân khẩu<o:p></o:p></span></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Địa chỉ: ");
                result.Append(hh.Address);
                result.Append("<span style='mso-tab-count:1'>  </span><o:p></o:p></span></p>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'>");
                result.Append("<b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>");
                result.Append("THÀNH PHẦN HỘI ĐỘNG BỒI THƯỜNG, HỖ TRỢ VÀ TÁI ĐỊNH CƯ:<o:p></o:p></span></b></p>");
                #endregion


                result.Append(getManageByProject(projectID));
                #region Thành phần áp giá bồi thường hỗ trợ
                result.Append("<tr style='mso-yfti-irow:7;height:19.85pt'>");
                result.Append("<td width=243 style='width:182.6pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>- Ông:...............................<o:p></o:p></span></p></td>");

                result.Append("<td width=265 style='width:7.0cm;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Thành viên ban tư vấn GPMB<o:p></o:p></span></p></td>");

                result.Append("<td width=168 style='width:125.85pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td></tr>");
                //--------------------------
                result.Append("<tr style='mso-yfti-irow:8;height:19.85pt'>");
                result.Append("<td width=243 style='width:182.6pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>- Ông:...............................<o:p></o:p></span></p></td>");

                result.Append("<td width=265 style='width:7.0cm;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Chủ tịch UBND xã Hưng ........<o:p></o:p></span></p></td>");

                result.Append("<td width=168 style='width:125.85pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Thành viên hội đồng<o:p></o:p></span></p></td></tr>");
                //---------------------------
                //result.Append("<tr style='mso-yfti-irow:9;height:19.85pt'>");
                //result.Append("<td width=243 style='width:182.6pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                //result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>- Ông:...............................<o:p></o:p></span></p></td>");

                //result.Append("<td width=265 style='width:7.0cm;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                //result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Cán bộ địa chính xã<o:p></o:p></span></p></td>");

                //result.Append("<td width=168 style='width:125.85pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                //result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Thành viên hội đồng<o:p></o:p></span></p></td></tr>");
                //---------------------------
                //result.Append("<tr style='mso-yfti-irow:10;height:19.85pt'>");
                //result.Append("<td width=243 style='width:182.6pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                //result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>- Ông:...............................<o:p></o:p></span></p></td>");

                //result.Append("<td width=265 style='width:7.0cm;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                //result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Xóm trưởng xóm ...........<o:p></o:p></span></p></td>");

                //result.Append("<td width=168 style='width:125.85pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                //result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p></o:p></span></p></td></tr>");
                //------------
                result.Append("<tr style='mso-yfti-irow:9;mso-yfti-lastrow:yes;height:19.85pt'>");
                result.Append("<td width=243 style='width:182.6pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>- Ông:...............................<o:p></o:p></span></p></td>");

                result.Append("<td width=265 style='width:7.0cm;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Đại diện hộ gia đình<o:p></o:p></span></p></td>");

                result.Append("<td width=168 style='width:125.85pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p></o:p></span></p></td></tr></table>");
                #endregion

                //----------
                #region Giá trị bồi thường các loại đất
                #region header
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'>");
                result.Append("<span style='font-size:13.0pt'>I. GIÁ TRỊ BỒI THƯỜNG CÁC LOẠI ĐẤT THU HỒI:</span></b>");
                result.Append("<span style='font-size:13.0pt'> <o:p></o:p></span></p>");
                result.Append("<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border:none;mso-border-alt:solid black .5pt;");
                result.Append("mso-border-themecolor:text1;mso-yfti-tbllook:1184;mso-padding-alt:0cm 5.4pt 0cm 5.4pt'>");
                result.Append("<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;height:19.85pt'>");
                //tt
                result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'>");
                result.Append("<b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>TT<o:p></o:p></span></b></p></td>");
                //Loại đất
                result.Append("<td width=206 style='width:154.75pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Loại đất<o:p></o:p></span></b></p></td>");
                //Diện tích
                result.Append("<td width=135 style='width:101.4pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'>");
                result.Append("<b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Diện tích đất (m<sup>2</sup>)<o:p></o:p></span></b></p></td>");
                //Đơn giá
                result.Append("<td width=135 style='width:101.4pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'>");
                result.Append("<b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Đơn giá (đồng)<o:p></o:p></span></b></p></td>");
                //thành tiền
                result.Append("<td width=135 style='width:101.4pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'>");
                result.Append("<b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Thành tiền (đồng)<o:p></o:p></span></b></p></td>");
                result.Append("</tr>");
                #endregion
                //row 1
                //TT
                row = 1;
                double landmoney = 0;
                if (listland.Count() == 0)
                {
                    //row 2
                    //TT
                    result.Append(" <tr style='mso-yfti-irow:1;height:19.85pt'>");
                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>1<o:p></o:p></span></p></td>");

                    //Loại đất
                    result.Append("<td width=206 style='width:154.75pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Đất nông nghiệp<o:p></o:p></span></p></td>");
                    //diện tích
                    result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");
                    //Đơn giá
                    result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");
                    //thành tiền
                    result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");
                    //row 2
                    //TT
                    result.Append(" <tr style='mso-yfti-irow:2;height:19.85pt'>");
                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>2<o:p></o:p></span></p></td>");

                    //Loại đất
                    result.Append("<td width=206 style='width:154.75pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Đất UBND xã quản lý<o:p></o:p></span></p></td>");
                    //diện tích
                    result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");
                    //Đơn giá
                    result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");
                    //thành tiền
                    result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");
                }

                foreach (var item in listland)
                {
                    result.Append(" <tr style='mso-yfti-irow:" + row + ";height:19.85pt'>");
                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>" + row.ToString() + "<o:p></o:p></span></p></td>");
                    //Loại đất
                    result.Append("<td width=206 style='width:154.75pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>" + item.LandName + "<o:p></o:p></span></p></td>");
                    //Diện tích
                    result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>" + item.Areas + "</o:p></span></p></td>");
                    //Đơn giá
                    result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p></o:p></span></p></td>");
                    //Thành tiền
                    result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    double zen = (double)item.toAmounts;
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>" + zen.ToString("###,###") + "</o:p></span></p></td>");
                    landmoney += zen;
                    money += zen;
                    row++;
                }

                //----------------Tổng
                //row 3
                //TT
                if (row == 1)
                {
                    result.Append(" <tr style='mso-yfti-irow:3;height:19.85pt'>");
                }
                else
                {
                    result.Append(" <tr style='mso-yfti-irow:" + row + ";height:19.85pt'>");
                }
                result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");
                //Cộng
                result.Append("<td width=206 style='width:154.75pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Cộng<o:p></o:p></span></b></p></td>");
                //Diện tích
                result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></b></span></p></td>");
                //Đơn giá
                result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></b></span></p></td>");
                //thành tiền
                result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'><o:p>" + landmoney.ToString("###,###") + "</o:p></b></span></p></td></tr></table>");
                #endregion

                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'>");
                result.Append("<span style='font-size:13.0pt'>II. GIÁ TRỊ BỒI THƯỜNG TÀI SẢN TRÊN ĐẤT:</span>");
                result.Append("</b><span style='font-size:13.0pt'> <o:p></o:p></span></p>");

                //-------------
                #region Giá trị bồi thường tài sản trên đất
                #region header
                result.Append("<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border:none;mso-border-alt:solid black .5pt;");
                result.Append("mso-border-themecolor:text1;mso-yfti-tbllook:1184;mso-padding-alt:0cm 5.4pt 0cm 5.4pt'>");
                //----tr 1
                result.Append("<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;height:19.85pt'>");
                result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>TT<o:p></o:p></span></b></p></td>");

                result.Append("<td width=161 style='width:120.5pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Tên hạng mục<o:p></o:p></span></b></p></td>");

                result.Append("<td width=104 style='width:77.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Thông số kỹ thuật<o:p></o:p></span></b></p></td>");

                result.Append("<td width=66 style='width:49.6pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Đơn vị tính<o:p></o:p></span></b></p></td>");

                result.Append("<td width=95 style='width:70.9pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Khối lượng<o:p></o:p></span></b></p></td>");

                result.Append("<td width=94 style='width:70.85pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Đơn giá (đồng)<o:p></o:p></span></b></p></td>");

                result.Append("<td width=92 style='width:69.15pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Thành tiền<o:p></o:p></span></b></p></td></tr>");
                #endregion
                // tr 2
                row = 1;

                double treemoney = 0;

                #region Cây cối hoa màu
                foreach (var item in listtree)
                {
                    result.Append("<tr style='mso-yfti-irow:" + row + ";height:19.85pt'>");
                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>");
                    result.Append(row + "<o:p></o:p></span></p></td>");

                    result.Append("<td width=161 style='width:120.5pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;>");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>");
                    result.Append(getTreeParent(item.TreeID) + "</o:p></span></p></td>");

                    result.Append("<td width=104 style='width:77.95pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                    result.Append("<td width=66 style='width:49.6pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><spanstyle='font-size:13.0pt'><o:p>");
                    result.Append(item.Unit + "</o:p></span></p></td>");

                    result.Append("<td width=95 style='width:70.9pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    result.Append(item.Quantity + "</o:p></span></p></td>");

                    result.Append("<td width=94 style='width:70.85pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    result.Append((item.UnitPrice.HasValue ? ((int)item.UnitPrice).ToString("###,###") : null) + "</o:p></span></p></td>");

                    result.Append("<td width=92 style='width:69.15pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    double zen = item.toAmount.HasValue ? item.toAmount.Value : 0;
                    result.Append(zen.ToString("###,###") + "</o:p></span></p></td></tr>");
                    money += zen;
                    treemoney += zen;
                    row++;
                }
                #endregion

                #region Nhà cửa
                double housemoney = 0;
                foreach (var item in listhouse)
                {
                    result.Append("<tr style='mso-yfti-irow:" + row + ";height:19.85pt'>");
                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>");
                    result.Append(row + "<o:p></o:p></span></p></td>");

                    result.Append("<td width=161 style='width:120.5pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;>");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>");
                    result.Append(getHouseParent(item.HouseID) + "</o:p></span></p></td>");

                    result.Append("<td width=104 style='width:77.95pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                    result.Append("<td width=66 style='width:49.6pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><spanstyle='font-size:13.0pt'><o:p>");
                    result.Append(item.Unit + "</o:p></span></p></td>");

                    result.Append("<td width=95 style='width:70.9pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    result.Append(item.Quantity + "</o:p></span></p></td>");

                    result.Append("<td width=94 style='width:70.85pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    result.Append((item.UnitPrice.HasValue ? ((int)item.UnitPrice).ToString("###,###") : null) + "</o:p></span></p></td>");

                    result.Append("<td width=92 style='width:69.15pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    double zen = item.toAmount.HasValue ? item.toAmount.Value : 0;
                    result.Append(zen.ToString("###,###") + "</o:p></span></p></td></tr>");
                    money += zen;
                    housemoney += zen;
                    row++;
                }
                #endregion

                #region công trình kiến trúc
                double buildmoney = 0;
                foreach (var item in listbuild)
                {
                    result.Append("<tr style='mso-yfti-irow:" + row + ";height:19.85pt'>");
                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>");
                    result.Append(row + "<o:p></o:p></span></p></td>");

                    result.Append("<td width=161 style='width:120.5pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;>");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>");
                    result.Append(getBuildParent(item.BuildingID) + "</o:p></span></p></td>");

                    result.Append("<td width=104 style='width:77.95pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                    result.Append("<td width=66 style='width:49.6pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><spanstyle='font-size:13.0pt'><o:p>");
                    result.Append(item.Unit + "</o:p></span></p></td>");

                    result.Append("<td width=95 style='width:70.9pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    result.Append(item.Quantity + "</o:p></span></p></td>");

                    result.Append("<td width=94 style='width:70.85pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    result.Append((item.UnitPrice.HasValue ? ((int)item.UnitPrice).ToString("###,###") : null) + "</o:p></span></p></td>");

                    result.Append("<td width=92 style='width:69.15pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    double zen = item.toAmount.HasValue ? item.toAmount.Value : 0;
                    result.Append(zen.ToString("###,###") + "</o:p></span></p></td></tr>");
                    money += zen;
                    buildmoney += zen;
                    row++;
                }
                #endregion

                #region Mồ mả
                double gravemoney = 0;
                foreach (var item in listgrave)
                {
                    result.Append("<tr style='mso-yfti-irow:" + row + ";height:19.85pt'>");
                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>");
                    result.Append(row + "<o:p></o:p></span></p></td>");

                    result.Append("<td width=161 style='width:120.5pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;>");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>");
                    result.Append(item.GraveName + "</o:p></span></p></td>");

                    result.Append("<td width=104 style='width:77.95pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                    result.Append("<td width=66 style='width:49.6pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><spanstyle='font-size:13.0pt'><o:p>");
                    result.Append(item.Unit + "</o:p></span></p></td>");

                    result.Append("<td width=95 style='width:70.9pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    result.Append(item.Quantity + "</o:p></span></p></td>");

                    result.Append("<td width=94 style='width:70.85pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    result.Append((item.UnitPrice.HasValue ? ((int)item.UnitPrice).ToString("###,###") : null) + "</o:p></span></p></td>");

                    result.Append("<td width=92 style='width:69.15pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    double zen = (item.toAmount.HasValue ? item.toAmount.Value : 0);
                    result.Append(zen.ToString("###,###") + "</o:p></span></p></td></tr>");
                    money += zen;
                    gravemoney += zen;
                    row++;
                }
                #endregion

                #region neu ko co den bu
                if (treemoney == 0 && housemoney == 0 && buildmoney == 0 && gravemoney == 0)
                {
                    for (int i = 1; i <= 3; i++)
                    {
                        result.Append("<tr style='mso-yfti-irow:" + i + ";height:19.85pt'>");
                        result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                        result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>");
                        result.Append(i + "<o:p></o:p></span></p></td>");

                        result.Append("<td width=161 style='width:120.5pt;border-top:none;border-left:none;");
                        result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                        result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;>");
                        result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                        result.Append("<td width=104 style='width:77.95pt;border-top:none;border-left:none;");
                        result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                        result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                        result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                        result.Append("<td width=66 style='width:49.6pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                        result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                        result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                        result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal align=center style='text-align:center'><spanstyle='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                        result.Append("<td width=95 style='width:70.9pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                        result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                        result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                        result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                        result.Append("<td width=94 style='width:70.85pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                        result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                        result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                        result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                        result.Append("<td width=92 style='width:69.15pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                        result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                        result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                        result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td></tr>");
                    }
                }
                #endregion

                #region tổng cộng
                //---r3
                result.Append("<tr style='mso-yfti-irow:2;height:19.85pt'>");
                result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;border-top:none;");
                result.Append("mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=161 style='width:120.5pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;>");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'><o:p>Cộng</o:p></span></b></p></td>");

                result.Append("<td width=104 style='width:77.95pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=66 style='width:49.6pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><spanstyle='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=95 style='width:70.9pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=94 style='width:70.85pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=92 style='width:69.15pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                result.Append((treemoney + housemoney + gravemoney + buildmoney).ToString("###,###") + "</o:p></span></p></td></tr></table>");
                #endregion
                //r 4

                #endregion

                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'>");
                result.Append("<span style='font-size:13.0pt'>III. TỔNG GIÁ TRỊ BỒI THƯỜNG<o:p></o:p></span></b></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p>");

                #region Tổng giá trị bồi thường
                #region header
                result.Append("<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border:none;mso-border-alt:solid black .5pt;");
                result.Append("mso-border-themecolor:text1;mso-yfti-tbllook:1184;mso-padding-alt:0cm 5.4pt 0cm 5.4pt'>");
                //r1
                result.Append("<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;height:19.85pt'>");

                result.Append("<td width=64 valign=top style='width:47.95pt;border:solid black 1.0pt;");
                result.Append("mso-border-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'>");
                result.Append("<b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>TT<o:p></o:p></span></b></p></td>");

                result.Append("<td width=255 style='width:191.35pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>HẠNG MỤC<o:p></o:p></span></b></p></td>");

                result.Append("<td width=208 style='width:155.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>SỐ LƯỢNG, DIỆN TÍCH<o:p></o:p></span></b></p></td>");

                result.Append("<td width=149 style='width:111.65pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>SỐ TIỀN<o:p></o:p></span></b></p></td></tr>");
                #endregion

                #region Đất
                //--r2
                #region header
                result.Append("<tr style='mso-yfti-irow:1;height:19.85pt'>");
                result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>I<o:p></o:p></span></p></td>");

                result.Append("<td width=255 style='width:191.35pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>ĐẤT<o:p></o:p></span></b></p></td>");

                result.Append("<td width=208 style='width:155.95pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=149 style='width:111.65pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td></tr>");
                #endregion
                //-r3
                if (landmoney == 0)
                {
                    #region Đất nông nghiệp
                    result.Append("<tr style='mso-yfti-irow:2;height:19.85pt'>");

                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>1<o:p></o:p></span></p></td>");

                    result.Append("<td width=255 style='width:191.35pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Đất nông nghiệp<o:p></o:p></span></p></td>");

                    result.Append("<td width=208 style='width:155.95pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                    result.Append("<td width=149 style='width:111.65pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td></tr>");
                    #endregion

                    #region Đất do UBND xã quản lý
                    //r4
                    result.Append("<tr style='mso-yfti-irow:3;height:19.85pt'>");
                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>2<o:p></o:p></span></p></td>");

                    result.Append("<td width=255 style='width:191.35pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Đất UBND xã quản lý<o:p></o:p></span></p></td>");

                    result.Append("<td width=208 style='width:155.95pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                    result.Append("<td width=149 style='width:111.65pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td></tr>");
                    #endregion
                }
                else
                {
                    int index = 2;
                    foreach (var item in listland)
                    {
                        result.Append("<tr style='mso-yfti-irow:" + index + ";height:19.85pt'>");
                        result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                        result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                        result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>" + (index - 1) + "<o:p></o:p></span></p></td>");

                        result.Append("<td width=255 style='width:191.35pt;border-top:none;border-left:none;");
                        result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                        result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                        result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>" + item.LandName + "<o:p></o:p></span></p></td>");

                        result.Append("<td width=208 style='width:155.95pt;border-top:none;border-left:none;");
                        result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                        result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                        result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>" + item.Areas + "</o:p></span></p></td>");

                        result.Append("<td width=149 style='width:111.65pt;border-top:none;border-left:none;");
                        result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                        result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                        result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>" + ((double)item.toAmounts).ToString("###,###") + " </o:p></span></p></td></tr>");
                        index++;
                    }
                }
                #endregion

                #region tài sản trên đất
                //--r5
                result.Append("<tr style='mso-yfti-irow:4;height:19.85pt'>");
                result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>II<o:p></o:p></span></p></td>");

                result.Append("<td width=255 style='width:191.35pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Tài sản trên đất<o:p></o:p></span></b></p></td>");

                result.Append("<td width=208 style='width:155.95pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=149 style='width:111.65pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td></tr>");
                #endregion

                #region Vật liệu kiến trúc
                //-r6
                result.Append("<tr style='mso-yfti-irow:5;height:19.85pt'>");
                result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>1<o:p></o:p></span></p></td>");

                result.Append("<td width=255 style='width:191.35pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Vật kiến trúc<o:p></o:p></span></p></td>");

                result.Append("<td width=208 style='width:155.95pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=149 style='width:111.65pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                result.Append(buildmoney.ToString("###,###") + "</o:p></span></p></td></tr>");
                #endregion
                //r7
                #region Cây cối hoa màu
                result.Append("<tr style='mso-yfti-irow:6;height:19.85pt'>");
                result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>2<o:p></o:p></span></p></td>");

                result.Append("<td width=255 style='width:191.35pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Cậy cối hoa màu<o:p></o:p></span></p></td>");

                result.Append("<td width=208 style='width:155.95pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=149 style='width:111.65pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                result.Append(treemoney.ToString("###,###") + "</o:p></span></p></td></tr>");
                #endregion

                #region đền bù nhà cửa
                int next = 0;
                if (housemoney != 0)
                {
                    next++;
                    result.Append("<tr style='mso-yfti-irow:7;height:19.85pt'>");
                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>" + (3+next) + "<o:p></o:p></span></p></td>");

                    result.Append("<td width=255 style='width:191.35pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Nhà cửa<o:p></o:p></span></p></td>");

                    result.Append("<td width=208 style='width:155.95pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                    result.Append("<td width=149 style='width:111.65pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    result.Append(housemoney.ToString("###,###") + "</o:p></span></p></td></tr>");
                }
                #endregion

                #region đền bù mồ mả
                if (gravemoney != 0)
                {
                    next++;
                    result.Append("<tr style='mso-yfti-irow:" + (7 + next) + ";height:19.85pt'>");
                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>" + (next+3) + "<o:p></o:p></span></p></td>");

                    result.Append("<td width=255 style='width:191.35pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Mồ mả<o:p></o:p></span></p></td>");

                    result.Append("<td width=208 style='width:155.95pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                    result.Append("<td width=149 style='width:111.65pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    result.Append(gravemoney.ToString("###,###") + "</o:p></span></p></td></tr>");
                }
                #endregion
                #region Tổng cộng
                //--r8
                result.Append("<tr style='mso-yfti-irow:" + (7 + next) + ";height:19.85pt'>");
                result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=255 style='width:191.35pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>TỔNG CỘNG</span></b><span style='font-size:13.0pt'><o:p></o:p></span></p></td>");

                result.Append("<td width=208 style='width:155.95pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=149 style='width:111.65pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                result.Append(money.ToString("###,###") + "</o:p></span></p></td></tr>");
                result.Append("</table>");
                #endregion
                #endregion

                #region Phần hỗ trợ, trợ cấp
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>IV. PHẦN HỖ TRỢ, TRỢ CẤP:<o:p></o:p></span></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>1. Hỗ trợ chuyển đôi nghề nghiệp và đào tạo việc làm:");
                double zenjob = 0;
                if (listjob != null)
                {
                    zenjob = listjob.toAmount.Value;
                    result.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + zenjob.ToString("###,###") + " &nbsp;&nbsp;&nbsp;&nbsp;VNĐ </o:p></span></p>");
                    money += zenjob;
                }
                else
                {
                    result.Append("...................................................................</o:p></span></p>");
                }
                result.Append("<span style='font-size:13.0pt'><o:p>2. Hỗ trợ ổn định sản xuất và ổn định đời sống:");
                double zenstabilizi = 0;
                if (liststabilizi != null)
                {
                    zenstabilizi = (double)liststabilizi.toAmount;
                    result.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + zenstabilizi.ToString("###,###") + "&nbsp;&nbsp;&nbsp;&nbsp;VNĐ</o:p></span></p>");
                    money += zenstabilizi;
                }
                else
                {
                    result.Append("...............................................................................</o:p></span></p>");
                }
                double zenrent = 0;
                int tt = 3;
                if (listRent != null)
                {
                    result.Append("<span style='font-size:13.0pt'><o:p>" + tt + ". Hỗ trợ thuê chỗ ở:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
                    zenrent = (double)listRent.toAmount;
                    money += zenrent;
                    result.Append(zenrent.ToString("###,###") + " &nbsp;&nbsp;&nbsp;&nbsp;VNĐ </o:p></span></p>");
                    tt++;
                }

                double zenmove = 0;
                if (listmove != null)
                {
                    result.Append("<span style='font-size:13.0pt'><o:p>" + tt + ". Hỗ trợ di chuyển:");
                    zenmove = (double)listmove.toAmount;
                    money += zenmove;
                    result.Append(zenmove.ToString("###,###") + " &nbsp;&nbsp;&nbsp;&nbsp;VNĐ </o:p></span></p>");
                    tt++;
                }
                //hỗ trợ khác

                double zenother = (double)listother.Sum(p => p.toAmount);
                if (zenother != 0)
                {
                    result.Append("<span style='font-size:13.0pt'>" + tt + ". Hỗ trợ khác:<o:p></o:p></span></p>");
                    foreach (var item in listother)
                    {

                        result.Append("<span style='font-size:13.0pt'><o:p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+ ");
                        result.Append(item.SupportName + ": &nbsp;");
                        result.Append(((double)item.toAmount).ToString("###,###") + "VNĐ </o:p></span></p>");
                        next++;
                    }
                    money += zenother;
                }
                #endregion
                #region footer
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Tổng giá trị bồi thường, hỗ trợ:");
                result.Append("...................................." + money.ToString("###,###") + ".....VNĐ.........................<o:p></o:p></span></b></p>");

                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>(<i style='mso-bidi-font-style:normal'>Bằng chữ:");
                result.Append(Utility.Utilities.DocTienBangChu((long)money, "đồng") + ")<o:p></o:p></i></span></b></p>");

                result.Append("<p class=MsoNormal><i style='mso-bidi-font-style:normal'><span style='font-size:13.0pt'>Vậy chúng tôi lập biên bản này để làm cơ sở cho các cấp thẩm định và chi trả./.<o:p></o:p></span></i></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p>");
                #endregion
                #region Chữ ký
                result.Append("<table class=MsoTableGrid cellspacing=0 cellpadding=0 style='border-collapse:collapse;border:none;mso-yfti-tbllook:1184;");
                result.Append("mso-padding-alt:0cm 5.4pt 0cm 5.4pt;mso-border-insideh:none;mso-border-insidev:none'>");
                //r1
                result.Append("<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;height:22.7pt'>");

                result.Append("<td width=174 style='width:130.25pt;padding:0cm 5.4pt 0cm 5.4pt;height:22.7pt'>");
                result.Append("<p class=MsoNormal align=center><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>CHỦ HỘ<o:p></o:p></span></b></p></td>");

                result.Append("<td width=316 style='width:236.65pt;padding:0cm 5.4pt 0cm 5.4pt;height:22.7pt'>");
                result.Append("<p class=MsoNormal align=center><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>CÁC THÀNH VIÊN THAM GIA<o:p></o:p></span></b></p></td>");

                result.Append("<td width=206 style='width:154.2pt;padding:0cm 5.4pt 0cm 5.4pt;height:22.7pt'><p class=MsoNormal align=center><b style='mso-bidi-font-weight:normal'>");
                result.Append("<span style='font-size:13.0pt'>CT.UBND XÃ<o:p></o:p></span></b></p></td></tr>");

                //r2
                result.Append("<tr style='mso-yfti-irow:1;height:87.85pt'>");
                result.Append("<td width=174 valign=bottom style='width:130.25pt;padding:0cm 5.4pt 0cm 5.4pt;height:87.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'>");
                result.Append("<span style='font-size:13.0pt'>&nbsp;<o:p></o:p></span></b></p></td>");

                result.Append("<td width=316 valign=bottom style='width:123.25pt;padding:0cm 5.4pt 0cm 5.4pt;height:90.15pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>&nbsp;<o:p></o:p></span></b></p></td>");

                result.Append("<td width=206 valign=bottom style='width:154.2pt;padding:0cm 5.4pt 0cm 5.4pt;height:87.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'>");
                result.Append("<span style='font-size:13.0pt'>&nbsp;<o:p></o:p></span></b></p></td></tr>");
                //r3
                result.Append("<tr style='mso-yfti-irow:2;height:22.7pt'>");
                result.Append("<td width=174 style='width:130.25pt;padding:0cm 5.4pt 0cm 5.4pt;height:22.7pt'>");
                result.Append("<p class=MsoNormal align=center><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>ĐD CHỦ ĐẦU TƯ<o:p></o:p></span></b></p></td>");

                result.Append("<td width=316 style='width:154.2pt;padding:0cm 5.4pt 0cm 5.4pt;height:22.7pt'>");
                result.Append("<p class=MsoNormal align=center><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>T. BAN TƯ VẤN GPMB<o:p></o:p></span></b></p></td>");

                result.Append("<td width=206 style='width:123.25pt;padding:0cm 5.4pt 0cm 5.4pt;height:22.7pt'>");
                result.Append("<p class=MsoNormal align=center><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>PHÒNG TN - MT<o:p></o:p></span></b></p></td></tr>");

                //r4
                result.Append("<tr style='mso-yfti-irow:3;height:90.15pt'>");
                result.Append("<td width=174 valign=bottom style='width:130.25pt;padding:0cm 5.4pt 0cm 5.4pt;height:90.15pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>&nbsp;<o:p></o:p></span></b></p></td>");

                result.Append("<td width=316 valign=bottom style='width:123.25pt;padding:0cm 5.4pt 0cm 5.4pt;height:90.15pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>&nbsp;<o:p></o:p></span></b></p></td>");

                result.Append("<td width=206 valign=bottom style='width:154.2pt;padding:0cm 5.4pt 0cm 5.4pt;height:90.15pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>&nbsp;<o:p></o:p></span></b></p></td></tr>");

                //r5
                result.Append("<tr style='mso-yfti-irow:4;height:22.7pt'>");
                result.Append("<td width=174 style='width:130.25pt;padding:0cm 5.4pt 0cm 5.4pt;height:22.7pt'>");
                result.Append("<p class=MsoNormal align=center><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>P. CÔNG THƯƠNG<o:p></o:p></span></b></p></td>");

                result.Append("<td width=316 style='width:4.0cm;padding:0cm 5.4pt 0cm 5.4pt;height:22.7pt'>");
                result.Append("<p class=MsoNormal align=center><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>PHÒNG TC - KH<o:p></o:p></span></b></p></td>");

                result.Append("<td width=206 style='width:154.2pt;padding:0cm 5.4pt 0cm 5.4pt;height:22.7pt'>");
                result.Append("<p class=MsoNormal align=center><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>CHỦ TỊCH HĐ GPMB<o:p></o:p></span></b></p></td></tr>");

                //r6
                result.Append("<tr style='mso-yfti-irow:5;height:90.15pt'>");
                result.Append("<td width=174 valign=bottom style='width:130.25pt;padding:0cm 5.4pt 0cm 5.4pt;height:90.15pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>&nbsp;<o:p></o:p></span></b></p></td>");

                result.Append("<td width=316 valign=bottom style='width:123.25pt;padding:0cm 5.4pt 0cm 5.4pt;height:90.15pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>&nbsp;<o:p></o:p></span></b></p></td>");

                result.Append("<td width=206 valign=bottom style='width:154.2pt;padding:0cm 5.4pt 0cm 5.4pt;height:90.15pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>&nbsp;<o:p></o:p></span></b></p></td></tr>");
                result.Append("</table>");
                result.Append("<br clear=all style='mso-special-character:line-break;page-break-before:always'>");
                #endregion
            }

            return result.ToString();
        }

        public string getHouseDetail(int projectID, string cmnd)
        {
            IEnumerable<HouseHold> h = new HouseHoldRepository().GetByProjectID(projectID).Where(p=>p.CMND==cmnd);
            Project project = new ProjectsRepository().GetByID(projectID);
            StringBuilder result = new StringBuilder();

            #region Khai báo dữ liệu
            int? totalrow = 0;
            var Itree = datacontext.uspGetInventTree(projectID, ref totalrow).ToArray();
            var Ihouse = datacontext.uspGetInventHouse(projectID, ref totalrow).ToArray();
            var Igrave = datacontext.uspGetInventGrave(projectID, ref totalrow).ToArray();
            var Ibuild = datacontext.uspGetInventBuilding(projectID, ref totalrow).ToArray();
            var mana = datacontext.uspgetManagementByProjectID(projectID);
            var supportjob = datacontext.uspEstimateSupportJob(projectID, ref totalrow).ToArray();
            var supportmove = datacontext.uspEstimateSupportMove(projectID, ref totalrow).ToArray();
            var supportOther = datacontext.uspEstimateSupportOther(projectID, ref totalrow).ToArray();
            var supportRent = datacontext.uspEstimateSupportRent(projectID, ref totalrow).ToArray();
            var supportstabilizi = datacontext.uspEstimateSupportStabilize(projectID, ref totalrow).ToArray();

            #endregion

            foreach (var hh in h)
            {
                int row = 1;
                double money = 0;
                var listland = datacontext.uspGetAllInventLand(projectID, hh.CMND).ToArray();
                var listtree = Itree.Where(p => p.CMND == hh.CMND);
                var listgrave = Igrave.Where(p => p.CMND == hh.CMND);
                var listhouse = Ihouse.Where(p => p.CMND == hh.CMND);
                var listbuild = Ibuild.Where(p => p.CMND == hh.CMND);
                var listjob = supportjob.Where(p => p.CMND == hh.CMND).FirstOrDefault();
                var liststabilizi = supportstabilizi.Where(p => p.CMND == hh.CMND).FirstOrDefault();
                var listRent = supportRent.Where(p => p.CMND == hh.CMND).FirstOrDefault();
                var listmove = supportmove.Where(p => p.CMND == hh.CMND).FirstOrDefault();
                var listother = supportOther.Where(p => p.CMND == hh.CMND);

                #region header
                result.Append("<table class=MsoTableGrid border=0 cellspacing=0 cellpadding=0 ");
                result.Append("style='border-collapse:collapse;border:none;mso-yfti-tbllook:1184;mso-padding-alt:");
                result.Append("0cm 5.4pt 0cm 5.4pt;mso-border-insideh:none;mso-border-insidev:none'>");
                result.Append("<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes;height:56.2pt'>");
                result.Append("<td width=310 valign=top style='width:232.2pt;padding:0cm 5.4pt 0cm 5.4pt;height:56.2pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>UBND HUYỆN HƯNG NGUYÊN<o:p></o:p></span></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><span style='mso-spacerun:yes'></span><u>HỘI ĐỒNG.GPMB CẤP TỈNH<o:p></o:p></u></span></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><span style='mso-spacerun:yes'></span><o:p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Số:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/HS-GPMB</o:p></span></p>");
                result.Append("</td>");
                result.Append("<td width=366 valign=top style='width:274.7pt;padding:0cm 5.4pt 0cm 5.4pt;height:56.2pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM<o:p></o:p></span></p>");

                result.Append("<p class=MsoNormal align=center style='text-align:center'><u><span style='font-size:13.0pt'>");
                result.Append("Độc lập – Tự do – Hạnh phúc<o:p></o:p></span></u></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td></tr></table>");

                result.Append("<p class=MsoNormal align=center style='text-align:center'>");
                result.Append("<span style='font-size:13.0pt'>BIÊN BẢN ÁP GIÁ BỒI THƯỜNG, HỖ TRỢ GIẢI PHÓNG MẶT BẰNG ĐỂ<o:p></o:p></span></p>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'>");
                result.Append("<span style='font-size:13.0pt'>THỰC HIỆN CÔNG TRÌNH: ");
                result.Append(project.ProjectName.ToUpper());
                result.Append("<o:p></o:p></span></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><span style='mso-tab-count:1'>");
                result.Append("</span>Hôm nay, ngày..........tháng.........năm 201..<o:p></o:p></span></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>");
                result.Append("<span style='mso-spacerun:yes'></span>");

                result.Append("Căn cứ vào biên bản kiểm kê hiện trạng, hồ sơ liên quan về đất đai và các chế độ bồi thường, ");
                result.Append("hỗ trợ hiện hành, hội đồng GPMB huyện tiến hành xác định giá trị bồi thường, ");
                result.Append("hỗ trợ về đấ và các tài sản trên đất của chủ hộ như sau:<o:p></o:p></span></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Chủ hộ: ");
                result.Append("Ông(bà).........................");
                result.Append(hh.FullName + "......................");
                result.Append("Có....." + hh.MemberCount + "...nhân khẩu<o:p></o:p></span></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Địa chỉ: ");
                result.Append(hh.Address);
                result.Append("<span style='mso-tab-count:1'>  </span><o:p></o:p></span></p>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'>");
                result.Append("<b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>");
                result.Append("THÀNH PHẦN ÁP GIÁ BỒI THƯỜNG, HỖ TRỢ:<o:p></o:p></span></b></p>");
                #endregion


                result.Append(getManageByProject(projectID));
                #region Thành phần áp giá bồi thường hỗ trợ
                result.Append("<tr style='mso-yfti-irow:7;height:19.85pt'>");
                result.Append("<td width=243 style='width:182.6pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>- Ông:...............................<o:p></o:p></span></p></td>");

                result.Append("<td width=265 style='width:7.0cm;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Thành viên ban tư vấn GPMB<o:p></o:p></span></p></td>");

                result.Append("<td width=168 style='width:125.85pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td></tr>");
                //--------------------------
                result.Append("<tr style='mso-yfti-irow:8;height:19.85pt'>");
                result.Append("<td width=243 style='width:182.6pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>- Ông:...............................<o:p></o:p></span></p></td>");

                result.Append("<td width=265 style='width:7.0cm;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Chủ tịch UBND xã Hưng ........<o:p></o:p></span></p></td>");

                result.Append("<td width=168 style='width:125.85pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Thành viên hội đồng<o:p></o:p></span></p></td></tr>");
                //---------------------------
                //result.Append("<tr style='mso-yfti-irow:9;height:19.85pt'>");
                //result.Append("<td width=243 style='width:182.6pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                //result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>- Ông:...............................<o:p></o:p></span></p></td>");

                //result.Append("<td width=265 style='width:7.0cm;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                //result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Cán bộ địa chính xã<o:p></o:p></span></p></td>");

                //result.Append("<td width=168 style='width:125.85pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                //result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Thành viên hội đồng<o:p></o:p></span></p></td></tr>");
                ////---------------------------
                //result.Append("<tr style='mso-yfti-irow:10;height:19.85pt'>");
                //result.Append("<td width=243 style='width:182.6pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                //result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>- Ông:...............................<o:p></o:p></span></p></td>");

                //result.Append("<td width=265 style='width:7.0cm;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                //result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Xóm trưởng xóm ...........<o:p></o:p></span></p></td>");

                //result.Append("<td width=168 style='width:125.85pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                //result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p></o:p></span></p></td></tr>");
                //------------
                result.Append("<tr style='mso-yfti-irow:9;mso-yfti-lastrow:yes;height:19.85pt'>");
                result.Append("<td width=243 style='width:182.6pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>- Ông:...............................<o:p></o:p></span></p></td>");

                result.Append("<td width=265 style='width:7.0cm;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Đại diện hộ gia đình<o:p></o:p></span></p></td>");

                result.Append("<td width=168 style='width:125.85pt;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p></o:p></span></p></td></tr></table>");
                #endregion

                //----------
                #region Giá trị bồi thường các loại đất
                #region header
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'>");
                result.Append("<span style='font-size:13.0pt'>I. GIÁ TRỊ BỒI THƯỜNG CÁC LOẠI ĐẤT THU HỒI:</span></b>");
                result.Append("<span style='font-size:13.0pt'> <o:p></o:p></span></p>");
                result.Append("<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border:none;mso-border-alt:solid black .5pt;");
                result.Append("mso-border-themecolor:text1;mso-yfti-tbllook:1184;mso-padding-alt:0cm 5.4pt 0cm 5.4pt'>");
                result.Append("<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;height:19.85pt'>");
                //tt
                result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'>");
                result.Append("<b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>TT<o:p></o:p></span></b></p></td>");
                //Loại đất
                result.Append("<td width=206 style='width:154.75pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Loại đất<o:p></o:p></span></b></p></td>");
                //Diện tích
                result.Append("<td width=135 style='width:101.4pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'>");
                result.Append("<b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Diện tích đất (m<sup>2</sup>)<o:p></o:p></span></b></p></td>");
                //Đơn giá
                result.Append("<td width=135 style='width:101.4pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'>");
                result.Append("<b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Đơn giá (đồng)<o:p></o:p></span></b></p></td>");
                //thành tiền
                result.Append("<td width=135 style='width:101.4pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'>");
                result.Append("<b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Thành tiền (đồng)<o:p></o:p></span></b></p></td>");
                result.Append("</tr>");
                #endregion
                //row 1
                //TT
                row = 1;
                double landmoney = 0;
                if (listland.Count() == 0)
                {
                    //row 2
                    //TT
                    result.Append(" <tr style='mso-yfti-irow:1;height:19.85pt'>");
                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>1<o:p></o:p></span></p></td>");

                    //Loại đất
                    result.Append("<td width=206 style='width:154.75pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Đất nông nghiệp<o:p></o:p></span></p></td>");
                    //diện tích
                    result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");
                    //Đơn giá
                    result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");
                    //thành tiền
                    result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");
                    //row 2
                    //TT
                    result.Append(" <tr style='mso-yfti-irow:2;height:19.85pt'>");
                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>2<o:p></o:p></span></p></td>");

                    //Loại đất
                    result.Append("<td width=206 style='width:154.75pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Đất UBND xã quản lý<o:p></o:p></span></p></td>");
                    //diện tích
                    result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");
                    //Đơn giá
                    result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");
                    //thành tiền
                    result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");
                }

                foreach (var item in listland)
                {
                    result.Append(" <tr style='mso-yfti-irow:" + row + ";height:19.85pt'>");
                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>" + row.ToString() + "<o:p></o:p></span></p></td>");
                    //Loại đất
                    result.Append("<td width=206 style='width:154.75pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>" + item.LandName  + "<o:p></o:p></span></p></td>");
                    //Diện tích
                    result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>" + item.Areas + "</o:p></span></p></td>");
                    //Đơn giá
                    result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p></o:p></span></p></td>");
                    //Thành tiền
                    result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                    result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                    result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    double zen = (double)item.toAmounts;
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>" + zen.ToString("###,###") + "</o:p></span></p></td>");
                    landmoney += zen;
                    money += zen;
                    row++;
                }

                //----------------Tổng
                //row 3
                //TT
                if (row == 1)
                {
                    result.Append(" <tr style='mso-yfti-irow:3;height:19.85pt'>");
                }
                else
                {
                    result.Append(" <tr style='mso-yfti-irow:" + row + ";height:19.85pt'>");
                }
                result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");
                //Cộng
                result.Append("<td width=206 style='width:154.75pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Cộng<o:p></o:p></span></b></p></td>");
                //Diện tích
                result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></b></span></p></td>");
                //Đơn giá
                result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></b></span></p></td>");
                //thành tiền
                result.Append("<td width=135 style='width:101.4pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;");
                result.Append("mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;");
                result.Append("padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'><o:p>" + landmoney.ToString("###,###") + "</o:p></b></span></p></td></tr></table>");
                #endregion

                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'>");
                result.Append("<span style='font-size:13.0pt'>II. GIÁ TRỊ BỒI THƯỜNG TÀI SẢN TRÊN ĐẤT:</span>");
                result.Append("</b><span style='font-size:13.0pt'> <o:p></o:p></span></p>");

                //-------------
                #region Giá trị bồi thường tài sản trên đất
                #region header
                result.Append("<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border:none;mso-border-alt:solid black .5pt;");
                result.Append("mso-border-themecolor:text1;mso-yfti-tbllook:1184;mso-padding-alt:0cm 5.4pt 0cm 5.4pt'>");
                //----tr 1
                result.Append("<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;height:19.85pt'>");
                result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>TT<o:p></o:p></span></b></p></td>");

                result.Append("<td width=161 style='width:120.5pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Tên hạng mục<o:p></o:p></span></b></p></td>");

                result.Append("<td width=104 style='width:77.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Thông số kỹ thuật<o:p></o:p></span></b></p></td>");

                result.Append("<td width=66 style='width:49.6pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Đơn vị tính<o:p></o:p></span></b></p></td>");

                result.Append("<td width=95 style='width:70.9pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Khối lượng<o:p></o:p></span></b></p></td>");

                result.Append("<td width=94 style='width:70.85pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Đơn giá (đồng)<o:p></o:p></span></b></p></td>");

                result.Append("<td width=92 style='width:69.15pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Thành tiền<o:p></o:p></span></b></p></td></tr>");
                #endregion
                // tr 2
                row = 1;

                double treemoney = 0;

                #region Cây cối hoa màu
                foreach (var item in listtree)
                {
                    result.Append("<tr style='mso-yfti-irow:" + row + ";height:19.85pt'>");
                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>");
                    result.Append(row + "<o:p></o:p></span></p></td>");

                    result.Append("<td width=161 style='width:120.5pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;>");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>");
                    result.Append(getTreeParent(item.TreeID) + "</o:p></span></p></td>");

                    result.Append("<td width=104 style='width:77.95pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                    result.Append("<td width=66 style='width:49.6pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><spanstyle='font-size:13.0pt'><o:p>");
                    result.Append(item.Unit + "</o:p></span></p></td>");

                    result.Append("<td width=95 style='width:70.9pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    result.Append(item.Quantity + "</o:p></span></p></td>");

                    result.Append("<td width=94 style='width:70.85pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    result.Append((item.UnitPrice.HasValue ? ((int)item.UnitPrice).ToString("###,###") : null) + "</o:p></span></p></td>");

                    result.Append("<td width=92 style='width:69.15pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    double zen = item.toAmount.HasValue ? item.toAmount.Value : 0;
                    result.Append(zen.ToString("###,###") + "</o:p></span></p></td></tr>");
                    money += zen;
                    treemoney += zen;
                    row++;
                }
                #endregion

                #region Nhà cửa
                double housemoney = 0;
                foreach (var item in listhouse)
                {
                    result.Append("<tr style='mso-yfti-irow:" + row + ";height:19.85pt'>");
                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>");
                    result.Append(row + "<o:p></o:p></span></p></td>");

                    result.Append("<td width=161 style='width:120.5pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;>");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>");
                    result.Append(getHouseParent(item.HouseID) + "</o:p></span></p></td>");

                    result.Append("<td width=104 style='width:77.95pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                    result.Append("<td width=66 style='width:49.6pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><spanstyle='font-size:13.0pt'><o:p>");
                    result.Append(item.Unit + "</o:p></span></p></td>");

                    result.Append("<td width=95 style='width:70.9pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    result.Append(item.Quantity + "</o:p></span></p></td>");

                    result.Append("<td width=94 style='width:70.85pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    result.Append((item.UnitPrice.HasValue ? ((int)item.UnitPrice).ToString("###,###") : null) + "</o:p></span></p></td>");

                    result.Append("<td width=92 style='width:69.15pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    double zen = item.toAmount.HasValue ? item.toAmount.Value : 0;
                    result.Append(zen.ToString("###,###") + "</o:p></span></p></td></tr>");
                    money += zen;
                    housemoney += zen;
                    row++;
                }
                #endregion

                #region công trình kiến trúc
                double buildmoney = 0;
                foreach (var item in listbuild)
                {
                    result.Append("<tr style='mso-yfti-irow:" + row + ";height:19.85pt'>");
                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>");
                    result.Append(row + "<o:p></o:p></span></p></td>");

                    result.Append("<td width=161 style='width:120.5pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;>");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>");
                    result.Append(getBuildParent(item.BuildingID) + "</o:p></span></p></td>");

                    result.Append("<td width=104 style='width:77.95pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p></o:p></span></p></td>");

                    result.Append("<td width=66 style='width:49.6pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><spanstyle='font-size:13.0pt'><o:p>");
                    result.Append(item.Unit + "</o:p></span></p></td>");

                    result.Append("<td width=95 style='width:70.9pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    result.Append(item.Quantity + "</o:p></span></p></td>");

                    result.Append("<td width=94 style='width:70.85pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    result.Append((item.UnitPrice.HasValue ? ((int)item.UnitPrice).ToString("###,###") : null) + "</o:p></span></p></td>");

                    result.Append("<td width=92 style='width:69.15pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    double zen = item.toAmount.HasValue ? item.toAmount.Value : 0;
                    result.Append(zen.ToString("###,###") + "</o:p></span></p></td></tr>");
                    money += zen;
                    buildmoney += zen;
                    row++;
                }
                #endregion

                #region Mồ mả
                double gravemoney = 0;
                foreach (var item in listgrave)
                {
                    result.Append("<tr style='mso-yfti-irow:" + row + ";height:19.85pt'>");
                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>");
                    result.Append(row + "<o:p></o:p></span></p></td>");

                    result.Append("<td width=161 style='width:120.5pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;>");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>");
                    result.Append(item.GraveName + "</o:p></span></p></td>");

                    result.Append("<td width=104 style='width:77.95pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                    result.Append("<td width=66 style='width:49.6pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><spanstyle='font-size:13.0pt'><o:p>");
                    result.Append(item.Unit + "</o:p></span></p></td>");

                    result.Append("<td width=95 style='width:70.9pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    result.Append(item.Quantity + "</o:p></span></p></td>");

                    result.Append("<td width=94 style='width:70.85pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    result.Append((item.UnitPrice.HasValue ? ((int)item.UnitPrice).ToString("###,###") : null) + "</o:p></span></p></td>");

                    result.Append("<td width=92 style='width:69.15pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                    result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                    result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    double zen = (item.toAmount.HasValue ? item.toAmount.Value : 0);
                    result.Append(zen.ToString("###,###") + "</o:p></span></p></td></tr>");
                    money += zen;
                    gravemoney += zen;
                    row++;
                }
                #endregion

                #region neu ko co den bu
                if (treemoney == 0 && housemoney == 0 && buildmoney == 0 && gravemoney == 0)
                {
                    for (int i = 1; i <= 3; i++)
                    {
                        result.Append("<tr style='mso-yfti-irow:" + i + ";height:19.85pt'>");
                        result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                        result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>");
                        result.Append(i + "<o:p></o:p></span></p></td>");

                        result.Append("<td width=161 style='width:120.5pt;border-top:none;border-left:none;");
                        result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                        result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;>");
                        result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                        result.Append("<td width=104 style='width:77.95pt;border-top:none;border-left:none;");
                        result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                        result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                        result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                        result.Append("<td width=66 style='width:49.6pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                        result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                        result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                        result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal align=center style='text-align:center'><spanstyle='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                        result.Append("<td width=95 style='width:70.9pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                        result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                        result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                        result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                        result.Append("<td width=94 style='width:70.85pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                        result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                        result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                        result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                        result.Append("<td width=92 style='width:69.15pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                        result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                        result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                        result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td></tr>");
                    }
                }
                #endregion

                #region tổng cộng
                //---r3
                result.Append("<tr style='mso-yfti-irow:2;height:19.85pt'>");
                result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;border-top:none;");
                result.Append("mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=161 style='width:120.5pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;>");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'><o:p>Cộng</o:p></span></b></p></td>");

                result.Append("<td width=104 style='width:77.95pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=66 style='width:49.6pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><spanstyle='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=95 style='width:70.9pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=94 style='width:70.85pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=92 style='width:69.15pt;border-top:none;border-left:none;border-bottom:solid black 1.0pt;");
                result.Append("mso-border-bottom-themecolor:text1;border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;");
                result.Append("mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                result.Append((treemoney + housemoney + gravemoney + buildmoney).ToString("###,###") + "</o:p></span></p></td></tr></table>");
                #endregion
                //r 4

                #endregion

                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'>");
                result.Append("<span style='font-size:13.0pt'>III. TỔNG GIÁ TRỊ BỒI THƯỜNG<o:p></o:p></span></b></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p>");

                #region Tổng giá trị bồi thường
                #region header
                result.Append("<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border:none;mso-border-alt:solid black .5pt;");
                result.Append("mso-border-themecolor:text1;mso-yfti-tbllook:1184;mso-padding-alt:0cm 5.4pt 0cm 5.4pt'>");
                //r1
                result.Append("<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;height:19.85pt'>");

                result.Append("<td width=64 valign=top style='width:47.95pt;border:solid black 1.0pt;");
                result.Append("mso-border-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'>");
                result.Append("<b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>TT<o:p></o:p></span></b></p></td>");

                result.Append("<td width=255 style='width:191.35pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>HẠNG MỤC<o:p></o:p></span></b></p></td>");

                result.Append("<td width=208 style='width:155.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>SỐ LƯỢNG, DIỆN TÍCH<o:p></o:p></span></b></p></td>");

                result.Append("<td width=149 style='width:111.65pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-left:none;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>SỐ TIỀN<o:p></o:p></span></b></p></td></tr>");
                #endregion

                #region Đất
                //--r2
                #region header
                result.Append("<tr style='mso-yfti-irow:1;height:19.85pt'>");
                result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>I<o:p></o:p></span></p></td>");

                result.Append("<td width=255 style='width:191.35pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>ĐẤT<o:p></o:p></span></b></p></td>");

                result.Append("<td width=208 style='width:155.95pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=149 style='width:111.65pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td></tr>");
                #endregion
                //-r3
                if (landmoney == 0)
                {
                    #region Đất nông nghiệp
                    result.Append("<tr style='mso-yfti-irow:2;height:19.85pt'>");

                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>1<o:p></o:p></span></p></td>");

                    result.Append("<td width=255 style='width:191.35pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Đất nông nghiệp<o:p></o:p></span></p></td>");

                    result.Append("<td width=208 style='width:155.95pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                    result.Append("<td width=149 style='width:111.65pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td></tr>");
                    #endregion

                    #region Đất do UBND xã quản lý
                    //r4
                    result.Append("<tr style='mso-yfti-irow:3;height:19.85pt'>");
                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>2<o:p></o:p></span></p></td>");

                    result.Append("<td width=255 style='width:191.35pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Đất UBND xã quản lý<o:p></o:p></span></p></td>");

                    result.Append("<td width=208 style='width:155.95pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                    result.Append("<td width=149 style='width:111.65pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td></tr>");
                    #endregion
                }
                else
                {
                    int index = 2;
                    foreach (var item in listland)
                    {
                        result.Append("<tr style='mso-yfti-irow:"+ index + ";height:19.85pt'>");
                        result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                        result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                        result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>" + (index - 1)  + "<o:p></o:p></span></p></td>");

                        result.Append("<td width=255 style='width:191.35pt;border-top:none;border-left:none;");
                        result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                        result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                        result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>" + item.LandName+ "<o:p></o:p></span></p></td>");

                        result.Append("<td width=208 style='width:155.95pt;border-top:none;border-left:none;");
                        result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                        result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                        result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>" + item.Areas + "</o:p></span></p></td>");

                        result.Append("<td width=149 style='width:111.65pt;border-top:none;border-left:none;");
                        result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                        result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                        result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                        result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>" + ((double)item.toAmounts).ToString("###,###") + " </o:p></span></p></td></tr>");
                        index++;
                    }
                }
                #endregion

                #region tài sản trên đất
                //--r5
                result.Append("<tr style='mso-yfti-irow:4;height:19.85pt'>");
                result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>II<o:p></o:p></span></p></td>");

                result.Append("<td width=255 style='width:191.35pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Tài sản trên đất<o:p></o:p></span></b></p></td>");

                result.Append("<td width=208 style='width:155.95pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=149 style='width:111.65pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td></tr>");
                #endregion

                #region Vật liệu kiến trúc
                //-r6
                result.Append("<tr style='mso-yfti-irow:5;height:19.85pt'>");
                result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>1<o:p></o:p></span></p></td>");

                result.Append("<td width=255 style='width:191.35pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Vật kiến trúc<o:p></o:p></span></p></td>");

                result.Append("<td width=208 style='width:155.95pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=149 style='width:111.65pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                result.Append(buildmoney.ToString("###,###") + "</o:p></span></p></td></tr>");
                #endregion
                //r7
                #region Cây cối hoa màu
                result.Append("<tr style='mso-yfti-irow:6;height:19.85pt'>");
                result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>2<o:p></o:p></span></p></td>");

                result.Append("<td width=255 style='width:191.35pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Cậy cối hoa màu<o:p></o:p></span></p></td>");

                result.Append("<td width=208 style='width:155.95pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=149 style='width:111.65pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                result.Append(treemoney.ToString("###,###") + "</o:p></span></p></td></tr>");
                #endregion

                #region đền bù nhà cửa
                int next = 0;
                if (housemoney != 0)
                {
                    next++;
                    result.Append("<tr style='mso-yfti-irow:7;height:19.85pt'>");
                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>" + (3 + next) + "<o:p></o:p></span></p></td>");

                    result.Append("<td width=255 style='width:191.35pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Nhà cửa<o:p></o:p></span></p></td>");

                    result.Append("<td width=208 style='width:155.95pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                    result.Append("<td width=149 style='width:111.65pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    result.Append(housemoney.ToString("###,###") + "</o:p></span></p></td></tr>");
                }
                #endregion

                #region đền bù mồ mả
                if (gravemoney != 0)
                {
                    next++;
                    result.Append("<tr style='mso-yfti-irow:" + (7 + next) + ";height:19.85pt'>");
                    result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                    result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                    result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'>" + (next + 3) + "<o:p></o:p></span></p></td>");

                    result.Append("<td width=255 style='width:191.35pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>Mồ mả<o:p></o:p></span></p></td>");

                    result.Append("<td width=208 style='width:155.95pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                    result.Append("<td width=149 style='width:111.65pt;border-top:none;border-left:none;");
                    result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                    result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                    result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                    result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                    result.Append(gravemoney.ToString("###,###") + "</o:p></span></p></td></tr>");
                }
                #endregion
                #region Tổng cộng
                //--r8
                result.Append("<tr style='mso-yfti-irow:" + (7 + next) + ";height:19.85pt'>");
                result.Append("<td width=64 style='width:47.95pt;border:solid black 1.0pt;mso-border-themecolor:text1;");
                result.Append("border-top:none;mso-border-top-alt:solid black .5pt;mso-border-top-themecolor:text1;");
                result.Append("mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=255 style='width:191.35pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>TỔNG CỘNG</span></b><span style='font-size:13.0pt'><o:p></o:p></span></p></td>");

                result.Append("<td width=208 style='width:155.95pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p></td>");

                result.Append("<td width=149 style='width:111.65pt;border-top:none;border-left:none;");
                result.Append("border-bottom:solid black 1.0pt;mso-border-bottom-themecolor:text1;");
                result.Append("border-right:solid black 1.0pt;mso-border-right-themecolor:text1;mso-border-top-alt:solid black .5pt;");
                result.Append("mso-border-top-themecolor:text1;mso-border-left-alt:solid black .5pt;mso-border-left-themecolor:text1;mso-border-alt:solid black .5pt;mso-border-themecolor:text1;padding:0cm 5.4pt 0cm 5.4pt;height:19.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><span style='font-size:13.0pt'><o:p>");
                result.Append(money.ToString("###,###") + "</o:p></span></p></td></tr>");
                result.Append("</table>");
                #endregion
                #endregion

                #region Phần hỗ trợ, trợ cấp
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'>IV. PHẦN HỖ TRỢ, TRỢ CẤP:<o:p></o:p></span></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>1. Hỗ trợ chuyển đôi nghề nghiệp và đào tạo việc làm:");
                double zenjob = 0;
                if (listjob != null)
                {
                    zenjob = listjob.toAmount.Value;
                    result.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + zenjob.ToString("###,###") + " &nbsp;&nbsp;&nbsp;&nbsp;VNĐ </o:p></span></p>");
                    money += zenjob;
                }
                else
                {
                    result.Append("...................................................................</o:p></span></p>");
                }
                result.Append("<span style='font-size:13.0pt'><o:p>2. Hỗ trợ ổn định sản xuất và ổn định đời sống:");
                double zenstabilizi = 0;
                if (liststabilizi != null)
                {
                    zenstabilizi = (double)liststabilizi.toAmount;
                    result.Append("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + zenstabilizi.ToString("###,###") + "&nbsp;&nbsp;&nbsp;&nbsp;VNĐ</o:p></span></p>");
                    money += zenstabilizi;
                }
                else
                {
                    result.Append("...............................................................................</o:p></span></p>");
                }
                double zenrent = 0;
                int tt = 3;
                if (listRent != null)
                {
                    result.Append("<span style='font-size:13.0pt'><o:p>" + tt + ". Hỗ trợ thuê chỗ ở:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
                    zenrent = (double)listRent.toAmount;
                    money += zenrent;
                    result.Append(zenrent.ToString("###,###") + " &nbsp;&nbsp;&nbsp;&nbsp;VNĐ </o:p></span></p>");
                    tt++;
                }

                double zenmove = 0;
                if (listmove != null)
                {
                    result.Append("<span style='font-size:13.0pt'><o:p>" + tt + ". Hỗ trợ di chuyển:");
                    zenmove = (double)listmove.toAmount;
                    money += zenmove;
                    result.Append(zenmove.ToString("###,###") + " &nbsp;&nbsp;&nbsp;&nbsp;VNĐ </o:p></span></p>");
                    tt++;
                }
                //hỗ trợ khác

                double zenother = (double)listother.Sum(p => p.toAmount);
                if (zenother != 0)
                {
                    result.Append("<span style='font-size:13.0pt'>" + tt + ". Hỗ trợ khác:<o:p></o:p></span></p>");
                    foreach (var item in listother)
                    {

                        result.Append("<span style='font-size:13.0pt'><o:p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+ ");
                        result.Append(item.SupportName + ": &nbsp;");
                        result.Append(((double)item.toAmount).ToString("###,###") + "VNĐ </o:p></span></p>");
                        next++;
                    }
                    money += zenother;
                }
                #endregion
                #region footer
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p>");
                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>Tổng giá trị bồi thường, hỗ trợ:");
                result.Append("...................................." + money.ToString("###,###") + ".....VNĐ.........................<o:p></o:p></span></b></p>");

                result.Append("<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>(<i style='mso-bidi-font-style:normal'>Bằng chữ:");
                result.Append(Utility.Utilities.DocTienBangChu((long)money, "đồng") + ")<o:p></o:p></i></span></b></p>");

                result.Append("<p class=MsoNormal><i style='mso-bidi-font-style:normal'><span style='font-size:13.0pt'>Vậy chúng tôi lập biên bản này để làm cơ sở cho các cấp thẩm định và chi trả./.<o:p></o:p></span></i></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p>");
                result.Append("<p class=MsoNormal><span style='font-size:13.0pt'><o:p>&nbsp;</o:p></span></p>");
                #endregion
                #region Chữ ký
                result.Append("<table class=MsoTableGrid cellspacing=0 cellpadding=0 style='border-collapse:collapse;border:none;mso-yfti-tbllook:1184;");
                result.Append("mso-padding-alt:0cm 5.4pt 0cm 5.4pt;mso-border-insideh:none;mso-border-insidev:none'>");
                //r1
                result.Append("<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;height:22.7pt'>");

                result.Append("<td width=174 style='width:130.25pt;padding:0cm 5.4pt 0cm 5.4pt;height:22.7pt'>");
                result.Append("<p class=MsoNormal align=center><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>CHỦ HỘ<o:p></o:p></span></b></p></td>");

                result.Append("<td width=316 style='width:236.65pt;padding:0cm 5.4pt 0cm 5.4pt;height:22.7pt'>");
                result.Append("<p class=MsoNormal align=center><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>CÁC THÀNH VIÊN THAM GIA<o:p></o:p></span></b></p></td>");

                result.Append("<td width=206 style='width:154.2pt;padding:0cm 5.4pt 0cm 5.4pt;height:22.7pt'><p class=MsoNormal align=center><b style='mso-bidi-font-weight:normal'>");
                result.Append("<span style='font-size:13.0pt'>CT.UBND XÃ<o:p></o:p></span></b></p></td></tr>");

                //r2
                result.Append("<tr style='mso-yfti-irow:1;height:87.85pt'>");
                result.Append("<td width=174 valign=bottom style='width:130.25pt;padding:0cm 5.4pt 0cm 5.4pt;height:87.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'>");
                result.Append("<span style='font-size:13.0pt'>&nbsp;<o:p></o:p></span></b></p></td>");

                result.Append("<td width=316 valign=bottom style='width:123.25pt;padding:0cm 5.4pt 0cm 5.4pt;height:90.15pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>&nbsp;<o:p></o:p></span></b></p></td>");

                result.Append("<td width=206 valign=bottom style='width:154.2pt;padding:0cm 5.4pt 0cm 5.4pt;height:87.85pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'>");
                result.Append("<span style='font-size:13.0pt'>&nbsp;<o:p></o:p></span></b></p></td></tr>");
                //r3
                result.Append("<tr style='mso-yfti-irow:2;height:22.7pt'>");
                result.Append("<td width=174 style='width:130.25pt;padding:0cm 5.4pt 0cm 5.4pt;height:22.7pt'>");
                result.Append("<p class=MsoNormal align=center><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>ĐD CHỦ ĐẦU TƯ<o:p></o:p></span></b></p></td>");

                result.Append("<td width=316 style='width:154.2pt;padding:0cm 5.4pt 0cm 5.4pt;height:22.7pt'>");
                result.Append("<p class=MsoNormal align=center><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>T. BAN TƯ VẤN GPMB<o:p></o:p></span></b></p></td>");

                result.Append("<td width=206 style='width:123.25pt;padding:0cm 5.4pt 0cm 5.4pt;height:22.7pt'>");
                result.Append("<p class=MsoNormal align=center><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>PHÒNG TN - MT<o:p></o:p></span></b></p></td></tr>");

                //r4
                result.Append("<tr style='mso-yfti-irow:3;height:90.15pt'>");
                result.Append("<td width=174 valign=bottom style='width:130.25pt;padding:0cm 5.4pt 0cm 5.4pt;height:90.15pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>&nbsp;<o:p></o:p></span></b></p></td>");

                result.Append("<td width=316 valign=bottom style='width:123.25pt;padding:0cm 5.4pt 0cm 5.4pt;height:90.15pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>&nbsp;<o:p></o:p></span></b></p></td>");

                result.Append("<td width=206 valign=bottom style='width:154.2pt;padding:0cm 5.4pt 0cm 5.4pt;height:90.15pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>&nbsp;<o:p></o:p></span></b></p></td></tr>");

                //r5
                result.Append("<tr style='mso-yfti-irow:4;height:22.7pt'>");
                result.Append("<td width=174 style='width:130.25pt;padding:0cm 5.4pt 0cm 5.4pt;height:22.7pt'>");
                result.Append("<p class=MsoNormal align=center><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>P. CÔNG THƯƠNG<o:p></o:p></span></b></p></td>");

                result.Append("<td width=316 style='width:4.0cm;padding:0cm 5.4pt 0cm 5.4pt;height:22.7pt'>");
                result.Append("<p class=MsoNormal align=center><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>PHÒNG TC - KH<o:p></o:p></span></b></p></td>");

                result.Append("<td width=206 style='width:154.2pt;padding:0cm 5.4pt 0cm 5.4pt;height:22.7pt'>");
                result.Append("<p class=MsoNormal align=center><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>CHỦ TỊCH HĐ GPMB<o:p></o:p></span></b></p></td></tr>");

                //r6
                result.Append("<tr style='mso-yfti-irow:5;height:90.15pt'>");
                result.Append("<td width=174 valign=bottom style='width:130.25pt;padding:0cm 5.4pt 0cm 5.4pt;height:90.15pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>&nbsp;<o:p></o:p></span></b></p></td>");

                result.Append("<td width=316 valign=bottom style='width:123.25pt;padding:0cm 5.4pt 0cm 5.4pt;height:90.15pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>&nbsp;<o:p></o:p></span></b></p></td>");

                result.Append("<td width=206 valign=bottom style='width:154.2pt;padding:0cm 5.4pt 0cm 5.4pt;height:90.15pt'>");
                result.Append("<p class=MsoNormal align=center style='text-align:center'><b style='mso-bidi-font-weight:normal'><span style='font-size:13.0pt'>&nbsp;<o:p></o:p></span></b></p></td></tr>");
                result.Append("</table>");
                #endregion
            }

            return result.ToString();
        }

        public string ExportProject(int ProjectID)
        {
            DataAccess.GPMBDataContext db = new DataAccess.GPMBDataContext();
            int? totalRow = 0;
            var listHouseHold = db.uspGetHouseHoldByProjectID(ProjectID, ref totalRow);
            var project = db.Projects.FirstOrDefault(p => p.ProjectID == ProjectID);
            int count = 1;
            int? TotalRowLand = 0, TotalRowTree = 0, TotalRowBuilding = 0, TotalRowHouse = 0, TotalRowGrave = 0;
            int? TotalRowSupportJob = 0, TotalRowSupportMove = 0, TotalRowSupportRent = 0, TotalRowSupportStabilize = 0, TotalRowSupportOther = 0;

            var inventLand = db.uspGetInventLand(ProjectID, ref TotalRowLand).ToArray();
            var inventTree = db.uspGetInventTree(ProjectID, ref TotalRowTree).ToArray();
            var inventBuilding = db.uspGetInventBuilding(ProjectID, ref TotalRowBuilding).ToArray();
            var inventHouse = db.uspGetInventHouse(ProjectID, ref TotalRowHouse).ToArray();
            var inventGrave = db.uspGetInventGrave(ProjectID, ref TotalRowGrave).ToArray();
            var supportJob = db.uspEstimateSupportJob(ProjectID, ref TotalRowSupportJob).ToArray();
            var supportRent = db.uspEstimateSupportRent(ProjectID, ref TotalRowSupportRent).ToArray();
            var supportStabilize = db.uspEstimateSupportStabilize(ProjectID, ref TotalRowSupportStabilize).ToArray();
            var supportMove = db.uspEstimateSupportMove(ProjectID, ref TotalRowSupportMove).ToArray();
            var supportOther = db.uspEstimateSupportOther(ProjectID, ref TotalRowSupportOther).ToArray();
            int? totalSupport = TotalRowSupportMove + TotalRowSupportRent + TotalRowSupportStabilize + TotalRowSupportOther;
            StringBuilder result = new StringBuilder();
            result.AppendLine("<table border=0 width='100%' >");
            result.AppendLine("<tr><td align=center><b>UBND HUYỆN HƯNG NGUYÊN <br>HĐ GPMB CẤP TỈNH</b></td><td align=center><b>CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM <br>Độc lập - Tự do - Hạnh phúc</b></td></tr>");
            result.AppendLine("</table>");
            result.AppendLine("<p class=MsoNormal>&nbsp;</p>");
            result.AppendLine("<p class=MsoNormal style='text-align:center'><b>BẢNG TỔNG HỢP DANH SÁCH THU HỒI ĐẤT VÀ</b></p>");
            result.AppendLine("<p class=MsoNormal style='text-align:center'><b>PHƯƠNG ÁN BỒI THƯỜNG HỖ TRỢ GPMB</b></p>");
            result.AppendLine("<p class=MsoNormal style='text-align:center'><b>DỰ ÁN " + project.ProjectName.ToUpper() + "</b></p>");
            result.AppendLine("<p class=MsoNormal>&nbsp;</p>");
            result.AppendLine("<table border='1' width='100%' style='border-collapse:collapse;'>");
            result.AppendLine("<thead>");
            result.AppendLine("<tr>"
                                + "<th width='40'>TT</th>"
                                + "<th width='300'>HỌ VÀ TÊN</th>"
                                + "<th width='350'> ĐỊA CHỈ</th>"
                                + "<th width='230'>TÊN ĐẤT</th>"
                                + "<th width='300'>VỊ TRÍ</th>"
                                + "<th width='200'>Ô THỬA</th>"
                                + "<th width='180'>TỜ BẢN ĐỒ</th>"
                                + "<th width='100'>DIỆN TÍCH</th>"
                                + "<th width='180'>ĐƠN GIÁ</th>"
                                + "<th width='180'>THÀNH TIỀN</th>"
                            );
            result.AppendLine("</tr></thead>");
            foreach (var item in listHouseHold)
            {
                var listLand = inventLand.Where(p => p.CMND.Equals(item.CMND)).ToArray();
                int countLand = listLand.Count();     
                int index = 0;            
                for (int i = 0; i < countLand; i++)
                {
                    result.AppendLine("<tr>");
                    if (index == 0)
                    {
                        result.AppendLine("<td rowspan='" + countLand + "'>" + count + "</td>");
                        result.AppendLine("<td rowspan='" + countLand + "'>" + item.FullName + "</td>");
                        result.AppendLine("<td rowspan='" + countLand + "'>" + item.Address + " - " + item.VillageName + "</td>");
                        count++;
                    }
                    DataAccess.uspGetInventLandResult land = new DataAccess.uspGetInventLandResult();
                    try
                    {
                        land = listLand[i];
                    }
                    catch { }
                    result.AppendLine("<td>" + land.LandName + "</td>");
                    result.AppendLine("<td>" + land.Position + "</td>");
                    result.AppendLine("<td>" + land.Plot + "</td>");
                    result.AppendLine("<td>" + land.ofMap + "</td>");
                    result.AppendLine("<td>" + land.Areas + "</td>");
                    result.AppendLine("<td>" + (int?)land.UnitPrice + "</td>");
                    result.AppendLine("<td>" + land.toAmounts + "</td>");
                    index++;
                }                
            }
            result.AppendLine("<tr><td colspan='7' align='center'><b>Tổng cộng</b></td>");
            result.AppendLine("<td>" + inventLand.Sum(p => p.Areas) + "</td><td>&nbsp;</td>");
            result.AppendLine("<td>" + inventLand.Sum(p => p.toAmounts) + "</td>");
            result.AppendLine("</table>");

            return result.ToString();
        }
    }
}